if ( key === "appendTo" ) {
this.menu.element.appendTo( $( value || "body", this.element[0].ownerDocument )[0] )
}
+ if ( key === "disabled" && value && this.xhr ) {
+ this.xhr.abort();
+ }
},
_initSource: function() {
} else if ( typeof this.options.source === "string" ) {
url = this.options.source;
this.source = function( request, response ) {
- if (self.xhr) {
+ if ( self.xhr ) {
self.xhr.abort();
}
self.xhr = $.ajax({
},
_response: function( content ) {
- if ( content && content.length ) {
+ if ( !this.options.disabled && content && content.length ) {
content = this._normalize( content );
this._suggest( content );
this._trigger( "open" );