diff options
author | Felix Nagel <info@felixnagel.com> | 2012-01-22 14:12:52 +0100 |
---|---|---|
committer | Felix Nagel <info@felixnagel.com> | 2012-01-22 14:12:52 +0100 |
commit | 725023e30db10cc0a3ec2b8b9fda0ec80a4ab496 (patch) | |
tree | f222fd297f472cdf87a8859deaba29838abb6670 /ui/jquery.ui.selectmenu.js | |
parent | d83e169424adf341afea4351cbe5b056f42ac996 (diff) | |
download | jquery-ui-725023e30db10cc0a3ec2b8b9fda0ec80a4ab496.tar.gz jquery-ui-725023e30db10cc0a3ec2b8b9fda0ec80a4ab496.zip |
Selectmenu: revert initial refresh method changes (with unit tests)
This reverts commit 27049fc5dc59522c38376d5c91f9f9a304e16613 and d83e169424adf341afea4351cbe5b056f42ac996
Diffstat (limited to 'ui/jquery.ui.selectmenu.js')
-rw-r--r-- | ui/jquery.ui.selectmenu.js | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/ui/jquery.ui.selectmenu.js b/ui/jquery.ui.selectmenu.js index 5802b6848..af34b4e19 100644 --- a/ui/jquery.ui.selectmenu.js +++ b/ui/jquery.ui.selectmenu.js @@ -185,6 +185,12 @@ $.widget( "ui.selectmenu", { open: function( event ) { if ( !this.options.disabled ) { + // init menu when initial opened + if ( !this.wasOpen ) { + this.refresh(); + this.wasOpen = true; + } + var currentItem = this._getSelectedItem(); this._toggleButtonStyle(); @@ -269,6 +275,11 @@ $.widget( "ui.selectmenu", { }, _move: function( direction, event ) { + // init menu when not done yet + if ( !this.wasOpen ) { + this.refresh(); + this.wasOpen = true; + } if ( direction == "first" || direction == "last" ) { // set focus manually for first or last item this.menu.menu( "focus", event, this.menu.find( "li" ).not( '.ui-selectmenu-optgroup' )[ direction ]() ); @@ -300,11 +311,6 @@ $.widget( "ui.selectmenu", { }, _buttonEvents: { - focus: function( event ) { - // init Menu on first focus - this.refresh(); - this.button.unbind( "focus." + this.widgetName ) - }, click: function( event ) { this._toggle( event ); event.preventDefault(); |