mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Selectmenu: use dynamic binding for document event
This commit is contained in:
parent
97cca1ed78
commit
ddf13472dd
6
ui/jquery.ui.selectmenu.js
vendored
6
ui/jquery.ui.selectmenu.js
vendored
@ -49,8 +49,6 @@ $.widget( "ui.selectmenu", {
|
|||||||
this._drawButton();
|
this._drawButton();
|
||||||
this._drawMenu();
|
this._drawMenu();
|
||||||
|
|
||||||
this._on( document, this._documentClick );
|
|
||||||
|
|
||||||
if ( this.options.disabled ) {
|
if ( this.options.disabled ) {
|
||||||
this.disable();
|
this.disable();
|
||||||
}
|
}
|
||||||
@ -196,6 +194,8 @@ $.widget( "ui.selectmenu", {
|
|||||||
this._toggleAttr();
|
this._toggleAttr();
|
||||||
this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
|
this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) );
|
||||||
|
|
||||||
|
this._on( this.document, this._documentClick );
|
||||||
|
|
||||||
this._trigger( "open", event );
|
this._trigger( "open", event );
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -212,6 +212,8 @@ $.widget( "ui.selectmenu", {
|
|||||||
this.menu.menu( "focus", null, this._getSelectedItem() );
|
this.menu.menu( "focus", null, this._getSelectedItem() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this._off( this.document );
|
||||||
|
|
||||||
this._trigger( "close", event );
|
this._trigger( "close", event );
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user