|
@@ -9714,9 +9714,23 @@ define('select2/results',[
|
|
|
this.$results.empty();
|
|
|
};
|
|
|
|
|
|
+ Results.prototype.empty = function () {
|
|
|
+ var $empty = $('<li role="treeitem" class="option"></li>');
|
|
|
+
|
|
|
+ $empty.text(this.options.get('translations').get('noResults'));
|
|
|
+
|
|
|
+ this.$results.append($empty);
|
|
|
+ };
|
|
|
+
|
|
|
Results.prototype.append = function (data) {
|
|
|
var $options = [];
|
|
|
|
|
|
+ if (data.length === 0) {
|
|
|
+ this.empty();
|
|
|
+
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
data = this.sort(data);
|
|
|
|
|
|
for (var d = 0; d < data.length; d++) {
|
|
@@ -10918,7 +10932,7 @@ define('select2/dropdown/search',[
|
|
|
|
|
|
define('select2/i18n/en',[],function () {
|
|
|
return {
|
|
|
- 'no_results': function () {
|
|
|
+ noResults: function () {
|
|
|
return 'No results found';
|
|
|
}
|
|
|
};
|