aboutsummaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
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