From 9202bb7df57b159003f6a0659cbe9359fdeb8196 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Scott=20Gonz=C3=A1lez?= Date: Thu, 25 Oct 2012 06:47:19 -0400 Subject: [PATCH] Autocomplete: Removed data fallback for item.autocomplete. Fixes #8156 - Autocomplete: Remove data fallbacks. --- demos/autocomplete/combobox.html | 1 - demos/autocomplete/custom-data.html | 1 - ui/jquery.ui.autocomplete.js | 8 ++------ 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/demos/autocomplete/combobox.html b/demos/autocomplete/combobox.html index cc43f4527..c8270c2d8 100644 --- a/demos/autocomplete/combobox.html +++ b/demos/autocomplete/combobox.html @@ -111,7 +111,6 @@ input.data( "autocomplete" )._renderItem = function( ul, item ) { return $( "
  • " ) - .data( "item.autocomplete", item ) .append( "" + item.label + "" ) .appendTo( ul ); }; diff --git a/demos/autocomplete/custom-data.html b/demos/autocomplete/custom-data.html index 1e64df047..df191b899 100644 --- a/demos/autocomplete/custom-data.html +++ b/demos/autocomplete/custom-data.html @@ -68,7 +68,6 @@ }) .data( "autocomplete" )._renderItem = function( ul, item ) { return $( "
  • " ) - .data( "item.autocomplete", item ) .append( "" + item.label + "
    " + item.desc + "
    " ) .appendTo( ul ); }; diff --git a/ui/jquery.ui.autocomplete.js b/ui/jquery.ui.autocomplete.js index 2d064834c..327bfa17e 100644 --- a/ui/jquery.ui.autocomplete.js +++ b/ui/jquery.ui.autocomplete.js @@ -237,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 ) ) { @@ -255,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) -- 2.39.5