]> source.dussan.org Git - jquery-ui.git/commitdiff
Autocomplete: Removed data fallback for item.autocomplete. Fixes #8156 - Autocomplete...
authorScott González <scott.gonzalez@gmail.com>
Thu, 25 Oct 2012 10:47:19 +0000 (06:47 -0400)
committerScott González <scott.gonzalez@gmail.com>
Thu, 25 Oct 2012 10:47:19 +0000 (06:47 -0400)
demos/autocomplete/combobox.html
demos/autocomplete/custom-data.html
ui/jquery.ui.autocomplete.js

index cc43f452771dccb59716e5b2630378fd0d912679..c8270c2d813b14d373a1603a20dbf469197cc18b 100644 (file)
 
                                input.data( "autocomplete" )._renderItem = function( ul, item ) {
                                        return $( "<li>" )
-                                               .data( "item.autocomplete", item )
                                                .append( "<a>" + item.label + "</a>" )
                                                .appendTo( ul );
                                };
index 1e64df047a4e4e46ecacaba3875bea0d4264dc2e..df191b89937be62152cc7278df1f56eae739d5fc 100644 (file)
@@ -68,7 +68,6 @@
                })
                .data( "autocomplete" )._renderItem = function( ul, item ) {
                        return $( "<li>" )
-                               .data( "item.autocomplete", item )
                                .append( "<a>" + item.label + "<br>" + item.desc + "</a>" )
                                .appendTo( ul );
                };
index 2d064834cee2087b6cef8c97a7956ef6430a52eb..327bfa17e2fced3382332b58b8fcac0ef2aa499e 100644 (file)
@@ -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)