]> source.dussan.org Git - jquery-ui.git/commitdiff
Selectmenu: do not call focus menu method when close method us used
authorFelix Nagel <info@felixnagel.com>
Thu, 30 May 2013 19:04:45 +0000 (21:04 +0200)
committerFelix Nagel <info@felixnagel.com>
Thu, 30 May 2013 19:04:45 +0000 (21:04 +0200)
ui/jquery.ui.selectmenu.js

index 701991e3bdba583c0ca12e841daa378f005feb2a..8b86b61a4582d382f86c9ed5825ba5f5eab5ed9e 100644 (file)
@@ -118,7 +118,7 @@ $.widget( "ui.selectmenu", {
                        .appendTo( this._appendTo() );
 
                // Init menu widget
-               menuInstance = this.menu.menu({
+               this.menuInstance = this.menu.menu({
                        select: function( event, ui ) {
                                var item = ui.item.data( "ui-selectmenu-item" );
 
@@ -151,9 +151,9 @@ $.widget( "ui.selectmenu", {
                this.menu.addClass( "ui-corner-bottom" ).removeClass( "ui-corner-all" );
 
                // Make sure focus stays on selected item
-               menuInstance.delay = 999999999;
+               this.menuInstance.delay = 999999999;
                // Unbind uneeded Menu events
-               menuInstance._off( this.menu, "mouseleave" );
+               this.menuInstance._off( this.menu, "mouseleave" );
        },
 
        refresh: function() {
@@ -210,7 +210,7 @@ $.widget( "ui.selectmenu", {
 
                // Check if we have an item to select
                if ( this.menuItems ) {
-                       this.menu.menu( "focus", null, this._getSelectedItem() );
+                       this.menuInstance.active = this._getSelectedItem();
                }
 
                this._off( this.document );