mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2025-01-05 15:32:10 +00:00
Call beforeRender even if there are no suggestions. Closes #507
This commit is contained in:
parent
a279fe90b3
commit
43a31502c4
@ -719,6 +719,7 @@
|
|||||||
|
|
||||||
noSuggestions: function() {
|
noSuggestions: function() {
|
||||||
var that = this,
|
var that = this,
|
||||||
|
beforeRender = that.options.beforeRender,
|
||||||
container = $(that.suggestionsContainer),
|
container = $(that.suggestionsContainer),
|
||||||
noSuggestionsContainer = $(that.noSuggestionsContainer);
|
noSuggestionsContainer = $(that.noSuggestionsContainer);
|
||||||
|
|
||||||
@ -727,9 +728,15 @@
|
|||||||
// Some explicit steps. Be careful here as it easy to get
|
// Some explicit steps. Be careful here as it easy to get
|
||||||
// noSuggestionsContainer removed from DOM if not detached properly.
|
// noSuggestionsContainer removed from DOM if not detached properly.
|
||||||
noSuggestionsContainer.detach();
|
noSuggestionsContainer.detach();
|
||||||
container.empty(); // clean suggestions if any
|
|
||||||
|
// clean suggestions if any
|
||||||
|
container.empty();
|
||||||
container.append(noSuggestionsContainer);
|
container.append(noSuggestionsContainer);
|
||||||
|
|
||||||
|
if ($.isFunction(beforeRender)) {
|
||||||
|
beforeRender.call(that.element, container, that.suggestions);
|
||||||
|
}
|
||||||
|
|
||||||
that.fixPosition();
|
that.fixPosition();
|
||||||
|
|
||||||
container.show();
|
container.show();
|
||||||
|
Loading…
Reference in New Issue
Block a user