mirror of
https://github.com/moodle/moodle.git
synced 2025-04-21 00:12:56 +02:00
MDL-55582 core_message: show message when there are no search results
This commit is contained in:
parent
b6723f5b22
commit
c9ead36a92
@ -233,7 +233,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
|
||||
return promises[0];
|
||||
}.bind(this)).then(function(data) {
|
||||
numberreceived = data.contacts.length;
|
||||
return templates.render('core_message/message_area_contacts', data);
|
||||
return templates.render('core_message/message_area_message_search_results', data);
|
||||
}).then(function(html, js) {
|
||||
// Remove the loading icon.
|
||||
this.messageArea.find(this.messageArea.SELECTORS.SEARCHRESULTSAREA + " " +
|
||||
@ -244,13 +244,15 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
|
||||
templates.appendNodeContents(this.messageArea.SELECTORS.SEARCHRESULTSAREA, html, js);
|
||||
// Increment the number of contacts displayed.
|
||||
this._numMessagesDisplayed += numberreceived;
|
||||
} else if (this._numMessagesDisplayed == 0) { // Must have nothing to begin with.
|
||||
// Replace the new content.
|
||||
templates.replaceNodeContents(this.messageArea.SELECTORS.SEARCHRESULTSAREA, html, js);
|
||||
}
|
||||
// Mark that we are no longer busy loading data.
|
||||
this._isLoading = false;
|
||||
}.bind(this)).fail(notification.exception);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Handles searching for people.
|
||||
*
|
||||
@ -330,6 +332,9 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
|
||||
templates.appendNodeContents(this.messageArea.SELECTORS.SEARCHRESULTSAREA, html, js);
|
||||
// Increment the number of contacts displayed.
|
||||
this._numPeopleDisplayed += numberreceived;
|
||||
} else if (this._numPeopleDisplayed == 0) { // Must have nothing to begin with.
|
||||
// Replace the new content.
|
||||
templates.replaceNodeContents(this.messageArea.SELECTORS.SEARCHRESULTSAREA, html, js);
|
||||
}
|
||||
// Mark that we are no longer busy loading data.
|
||||
this._isLoading = false;
|
||||
@ -349,7 +354,6 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/notification', 'core/str'
|
||||
}.bind(this));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Sets filter for search input.
|
||||
*
|
||||
|
@ -0,0 +1,6 @@
|
||||
{{#contacts}}
|
||||
{{> core_message/message_area_contact }}
|
||||
{{/contacts}}
|
||||
{{^contacts}}
|
||||
<div class="noresults">{{#str}}noresults{{/str}}</div>
|
||||
{{/contacts}}
|
@ -16,4 +16,11 @@
|
||||
{{#noncontacts}}
|
||||
{{> core_message/message_area_contact }}
|
||||
{{/noncontacts}}
|
||||
{{/hasnoncontacts}}
|
||||
{{/hasnoncontacts}}
|
||||
{{^hascontacts}}
|
||||
{{^hascourses}}
|
||||
{{^hasnoncontacts}}
|
||||
<div class="noresults">{{#str}}noresults{{/str}}</div>
|
||||
{{/hasnoncontacts}}
|
||||
{{/hascourses}}
|
||||
{{/hascontacts}}
|
||||
|
@ -132,6 +132,11 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
.noresults {
|
||||
padding-top: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.contacts {
|
||||
|
@ -5859,6 +5859,10 @@ a.ygtvspacer:hover {
|
||||
border: none;
|
||||
cursor: pointer;
|
||||
}
|
||||
.messaging-area-container .messaging-area .contacts-area .searcharea .noresults {
|
||||
padding-top: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.messaging-area-container .messaging-area .contacts-area .contacts {
|
||||
height: 500px;
|
||||
overflow-y: auto;
|
||||
|
Loading…
x
Reference in New Issue
Block a user