]> source.dussan.org Git - jquery-ui.git/commitdiff
Widget: Bind the remove event to the element, not the .widget() element.
authorScott González <scott.gonzalez@gmail.com>
Wed, 24 Oct 2012 16:00:03 +0000 (12:00 -0400)
committerScott González <scott.gonzalez@gmail.com>
Wed, 24 Oct 2012 16:00:03 +0000 (12:00 -0400)
ui/jquery.ui.autocomplete.js
ui/jquery.ui.widget.js

index 7bacca006d33a5b305485b0b8258b64f0917e544..2d064834cee2087b6cef8c97a7956ef6430a52eb 100644 (file)
@@ -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;
@@ -191,6 +191,7 @@ $.widget( "ui.autocomplete", {
                        .zIndex( this.element.zIndex() + 1 )
                        .hide()
                        .data( "menu" );
+
                this._on( this.menu.element, {
                        mousedown: function( event ) {
                                // prevent moving focus out of the text field
index a6eae65800ac45aef5502bf5d2a87624f5f0fbfe..f4805fb7576d95b50415a71815d63e466f6b96aa 100644 (file)
@@ -237,7 +237,7 @@ $.Widget.prototype = {
                        // TODO remove dual storage
                        $.data( element, this.widgetName, this );
                        $.data( element, this.widgetFullName, this );
-                       this._on({
+                       this._on( this.element, {
                                remove: function( event ) {
                                        if ( event.target === element ) {
                                                this.destroy();