1
0
mirror of synced 2024-11-26 23:06:02 +03:00

Update select2.js

Add a "Searching" label state for AJAX data
This commit is contained in:
bhoop 2012-08-06 17:42:05 -03:00
parent 3a1dcd14f3
commit b593d06d58

View File

@ -1081,6 +1081,9 @@
render("<li class='select2-no-results'>" + opts.formatInputTooShort(search.val(), opts.minimumInputLength) + "</li>"); render("<li class='select2-no-results'>" + opts.formatInputTooShort(search.val(), opts.minimumInputLength) + "</li>");
return; return;
} }
else {
render("<li class='select2-searching'>" + opts.formatSearching() + "</li>");
}
this.resultsPage = 1; this.resultsPage = 1;
opts.query({ opts.query({
@ -2193,6 +2196,7 @@
formatInputTooShort: function (input, min) { return "Please enter " + (min - input.length) + " more characters"; }, formatInputTooShort: function (input, min) { return "Please enter " + (min - input.length) + " more characters"; },
formatSelectionTooBig: function (limit) { return "You can only select " + limit + " items"; }, formatSelectionTooBig: function (limit) { return "You can only select " + limit + " items"; },
formatLoadMore: function (pageNumber) { return "Loading more results..."; }, formatLoadMore: function (pageNumber) { return "Loading more results..."; },
formatSearch: function () { return "Searching..."; },
minimumResultsForSearch: 0, minimumResultsForSearch: 0,
minimumInputLength: 0, minimumInputLength: 0,
maximumSelectionSize: 0, maximumSelectionSize: 0,