]> source.dussan.org Git - jquery-ui.git/commitdiff
Menubar: Another fix for tab/focus handling
authorjzaefferer <joern.zaefferer@gmail.com>
Thu, 17 Mar 2011 14:37:27 +0000 (15:37 +0100)
committerjzaefferer <joern.zaefferer@gmail.com>
Thu, 17 Mar 2011 14:37:27 +0000 (15:37 +0100)
tests/visual/menu/menubar.js

index 35d0cc24fcbeeaa84696f4bf71af2f0405c8a43e..3f4dba723683ce45d511b35b5aed8c169520b2a5 100644 (file)
@@ -41,8 +41,8 @@ $.widget("ui.menubar", {
                                        event.preventDefault();
                                        break;
                                };
-                       }).blur(function() {
-                               self._close();
+                       }).blur(function( event ) {
+                               self._close( event );
                        });
                });
                items.each(function() {
@@ -97,7 +97,9 @@ $.widget("ui.menubar", {
                });
                self._bind(document, {
                        click: function(event) {
-                               self.open && !$(event.target).closest(".ui-menubar").length && self._close();
+                               if (self.open && !$(event.target).closest(".ui-menubar").length) {
+                                       self._close();
+                               }
                        }
                })
                self._bind({
@@ -125,10 +127,10 @@ $.widget("ui.menubar", {
        },
        
        _open: function(event, menu) {
-               // TODO refactor with _close
+               // almost the same as _close above, but don't remove tabIndex
                if (this.active) {
                        this.active.menu("closeAll").hide();
-                       this.active.prev().removeClass("ui-state-active").removeAttr("tabIndex");
+                       this.active.prev().removeClass("ui-state-active");
                }
                clearTimeout(this.timer);
                this.open = true;