2
0
mirror of https://github.com/devbridge/jQuery-Autocomplete.git synced 2024-11-26 14:56:36 +00:00

Fix autocomplete disable function

This commit is contained in:
fede 2013-08-30 12:58:26 +02:00
parent 98cbd94598
commit d65e4e0369
2 changed files with 22 additions and 22 deletions

File diff suppressed because one or more lines are too long

View File

@ -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);
});
}
},