mirror of
https://github.com/devbridge/jQuery-Autocomplete.git
synced 2024-11-22 12:55:12 +00:00
Fix autocomplete disable function
This commit is contained in:
parent
98cbd94598
commit
d65e4e0369
18
dist/jquery.autocomplete.min.js
vendored
18
dist/jquery.autocomplete.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,11 +1,11 @@
|
||||
/**
|
||||
* Ajax Autocomplete for jQuery, version 1.2.7
|
||||
* (c) 2013 Tomas Kirda
|
||||
*
|
||||
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
|
||||
* For details, see the web site: http://www.devbridge.com/projects/autocomplete/jquery/
|
||||
*
|
||||
*/
|
||||
* Ajax Autocomplete for jQuery, version 1.2.7
|
||||
* (c) 2013 Tomas Kirda
|
||||
*
|
||||
* Ajax Autocomplete for jQuery is freely distributable under the terms of an MIT-style license.
|
||||
* For details, see the web site: http://www.devbridge.com/projects/autocomplete/jquery/
|
||||
*
|
||||
*/
|
||||
|
||||
/*jslint browser: true, white: true, plusplus: true */
|
||||
/*global define, window, document, jQuery */
|
||||
@ -220,6 +220,7 @@
|
||||
|
||||
disable: function () {
|
||||
this.disabled = true;
|
||||
clearInterval(this.onChangeInterval);
|
||||
if(this.currentRequest){
|
||||
this.currentRequest.abort();
|
||||
}
|
||||
@ -288,7 +289,7 @@
|
||||
|
||||
onKeyPress: function (e) {
|
||||
var that = this;
|
||||
|
||||
console.log(that.disabled);
|
||||
// If suggestions are hidden and user presses arrow down, display suggestions:
|
||||
if (!that.disabled && !that.visible && e.which === keys.DOWN && that.currentValue) {
|
||||
that.suggest();
|
||||
@ -315,7 +316,7 @@
|
||||
that.selectHint();
|
||||
return;
|
||||
}
|
||||
// Fall through to RETURN
|
||||
// Fall through to RETURN
|
||||
case keys.RETURN:
|
||||
if (that.selectedIndex === -1) {
|
||||
that.hide();
|
||||
@ -372,7 +373,6 @@
|
||||
onValueChange: function () {
|
||||
var that = this,
|
||||
q;
|
||||
|
||||
if (that.selection) {
|
||||
that.selection = null;
|
||||
(that.options.onInvalidateSelection || $.noop)();
|
||||
@ -442,9 +442,9 @@
|
||||
type: options.type,
|
||||
dataType: options.dataType
|
||||
}).done(function (data) {
|
||||
that.processResponse(data, q);
|
||||
options.onSearchComplete.call(that.element, q);
|
||||
});
|
||||
that.processResponse(data, q);
|
||||
options.onSearchComplete.call(that.element, q);
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user