diff options
author | Felix Nagel <info@felixnagel.com> | 2012-12-12 17:26:17 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-12-12 17:26:17 +0100 |
commit | 07328359e9f884e7ab23b431797b5d8f06ea9ec9 (patch) | |
tree | f970621524b51945368672ee18bbd742768a5643 /ui | |
parent | f6372bd7eac41ae2c022ef510ec414d016e820ed (diff) | |
download | jquery-ui-07328359e9f884e7ab23b431797b5d8f06ea9ec9.tar.gz jquery-ui-07328359e9f884e7ab23b431797b5d8f06ea9ec9.zip |
Selectmenu: use method _documentClick for adding events to the document
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index bc1109918..790a76e68 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -43,14 +43,7 @@ $.widget( "ui.selectmenu", { this._drawButton(); this._drawMenu(); - // document click closes menu - this._on( document, { - click: function( event ) { - if ( this.isOpen && !$( event.target ).closest( "li.ui-state-disabled, li.ui-selectmenu-optgroup, #" + this.ids.button ).length ) { - this.close( event ); - } - } - }); + this._on( document, this._documentClick ); if ( this.options.disabled ) { this.disable(); @@ -304,6 +297,14 @@ $.widget( "ui.selectmenu", { } }, + _documentClick: { + click: function( event ) { + if ( this.isOpen && !$( event.target ).closest( "li.ui-state-disabled, li.ui-selectmenu-optgroup, #" + this.ids.button ).length ) { + this.close( event ); + } + } + }, + _buttonEvents: { focus: function() { // init Menu on first focus |