Widget: Bind the remove event to the element, not the .widget() element.

This commit is contained in:
Scott González 2012-10-24 12:00:03 -04:00
parent 5f9d5c54c3
commit eaadcc0eeb
2 changed files with 3 additions and 2 deletions

View 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

View 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();