mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2025-01-03 14:47:25 +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() {
|
||||
var that = this,
|
||||
beforeRender = that.options.beforeRender,
|
||||
container = $(that.suggestionsContainer),
|
||||
noSuggestionsContainer = $(that.noSuggestionsContainer);
|
||||
|
||||
@ -727,9 +728,15 @@
|
||||
// Some explicit steps. Be careful here as it easy to get
|
||||
// noSuggestionsContainer removed from DOM if not detached properly.
|
||||
noSuggestionsContainer.detach();
|
||||
container.empty(); // clean suggestions if any
|
||||
|
||||
// clean suggestions if any
|
||||
container.empty();
|
||||
container.append(noSuggestionsContainer);
|
||||
|
||||
if ($.isFunction(beforeRender)) {
|
||||
beforeRender.call(that.element, container, that.suggestions);
|
||||
}
|
||||
|
||||
that.fixPosition();
|
||||
|
||||
container.show();
|
||||
|
Loading…
Reference in New Issue
Block a user