2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-25 06:07:45 +00:00

added onHide callback option

This commit is contained in:
Steffen Dietz 2014-08-28 12:14:36 +02:00
parent 41f2c3fd95
commit 5d5513f0f2

View File

@ -593,7 +593,14 @@
},
hide: function () {
var that = this;
var that = this,
container = $(that.suggestionsContainer);
if ($.isFunction(this.options.onHide) && that.visible) {
this.options.onHide.call(that.element, container);
}
that.visible = false;
that.selectedIndex = -1;
$(that.suggestionsContainer).hide();
@ -602,7 +609,7 @@
suggest: function () {
if (this.suggestions.length === 0) {
this.options.showNoSuggestionNotice ? this.noSuggestions() : this.hide();
this.options.showNoSuggestionNotice ? this.noSuggestions() : this.hide();
return;
}
@ -631,7 +638,7 @@
html += '<div class="' + className + '" data-index="' + i + '">' + formatResult(suggestion, value) + '</div>';
});
this.adjustContainerWidth();
this.adjustContainerWidth();
noSuggestionsContainer.detach();
container.html(html);