diff options
Diffstat (limited to 'ui/jquery.ui.autocomplete.js')
-rw-r--r-- | ui/jquery.ui.autocomplete.js | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index f181e9180..f5ab57bd4 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -64,7 +64,7 @@ $.widget( "ui.autocomplete", { .addClass( "ui-autocomplete-input" ) .attr( "autocomplete", "off" ); - this._on({ + this._on( this.element, { keydown: function( event ) { if ( this.element.prop( "readOnly" ) ) { suppressKeyPress = true; @@ -190,7 +190,8 @@ $.widget( "ui.autocomplete", { }) .zIndex( this.element.zIndex() + 1 ) .hide() - .data( "menu" ); + .data( "ui-menu" ); + this._on( this.menu.element, { mousedown: function( event ) { // prevent moving focus out of the text field @@ -236,9 +237,7 @@ $.widget( "ui.autocomplete", { } } - // back compat for _renderItem using item.autocomplete, via #7810 - // TODO remove the fallback, see #8156 - var item = ui.item.data( "ui-autocomplete-item" ) || ui.item.data( "item.autocomplete" ); + var item = ui.item.data( "ui-autocomplete-item" ); if ( false !== this._trigger( "focus", event, { item: item } ) ) { // use value to match what will end up in the input, if it was a key event if ( event.originalEvent && /^key/.test( event.originalEvent.type ) ) { @@ -254,9 +253,7 @@ $.widget( "ui.autocomplete", { } }, menuselect: function( event, ui ) { - // back compat for _renderItem using item.autocomplete, via #7810 - // TODO remove the fallback, see #8156 - var item = ui.item.data( "ui-autocomplete-item" ) || ui.item.data( "item.autocomplete" ), + var item = ui.item.data( "ui-autocomplete-item" ), previous = this.previous; // only trigger when focus was lost (click on menu) @@ -291,10 +288,6 @@ $.widget( "ui.autocomplete", { .addClass( "ui-helper-hidden-accessible" ) .insertAfter( this.element ); - if ( $.fn.bgiframe ) { - this.menu.element.bgiframe(); - } - // turning off autocomplete prevents the browser from remembering the // value when navigating through history, so we re-enable autocomplete // if the page is unloaded before the widget is destroyed. #7790 @@ -359,7 +352,7 @@ $.widget( "ui.autocomplete", { url: url, data: request, dataType: "json", - success: function( data, status ) { + success: function( data ) { response( data ); }, error: function() { @@ -541,7 +534,7 @@ $.widget( "ui.autocomplete", { return this.menu.element; }, - _value: function( value ) { + _value: function() { return this.valueMethod.apply( this.element, arguments ); }, |