diff options
author | Felix Nagel <info@felixnagel.com> | 2013-05-15 21:04:10 +0200 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2013-05-15 21:04:10 +0200 |
commit | ddf13472ddd0328a39229914685c27a61f5c03af (patch) | |
tree | 8e9fd3cf9d0c9df6e975047856f035af22c80dba /ui/jquery.ui.selectmenu.js | |
parent | 97cca1ed78e902b8580fb88da37122bf20893d89 (diff) | |
download | jquery-ui-ddf13472ddd0328a39229914685c27a61f5c03af.tar.gz jquery-ui-ddf13472ddd0328a39229914685c27a61f5c03af.zip |
Selectmenu: use dynamic binding for document event
Diffstat (limited to 'ui/jquery.ui.selectmenu.js')
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 339246304..76224fd7b 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -49,8 +49,6 @@ $.widget( "ui.selectmenu", { this._drawButton(); this._drawMenu(); - this._on( document, this._documentClick ); - if ( this.options.disabled ) { this.disable(); } @@ -196,6 +194,8 @@ $.widget( "ui.selectmenu", { this._toggleAttr(); this.menuWrap.position( $.extend( { of: this.button }, this.options.position ) ); + this._on( this.document, this._documentClick ); + this._trigger( "open", event ); }, @@ -212,6 +212,8 @@ $.widget( "ui.selectmenu", { this.menu.menu( "focus", null, this._getSelectedItem() ); } + this._off( this.document ); + this._trigger( "close", event ); }, |