aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorFelix Nagel <info@felixnagel.com>2012-12-12 17:26:17 +0100
committerFelix Nagel <info@felixnagel.com>2012-12-12 17:26:17 +0100
commit07328359e9f884e7ab23b431797b5d8f06ea9ec9 (patch)
treef970621524b51945368672ee18bbd742768a5643 /ui
parentf6372bd7eac41ae2c022ef510ec414d016e820ed (diff)
downloadjquery-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.js17
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