]> source.dussan.org Git - vaadin-framework.git/commitdiff
Reverted the fix for #5535 again, creating a proper ticket for the issue (need to...
authorJouni Koivuviita <jouni.koivuviita@itmill.com>
Fri, 20 May 2011 12:26:01 +0000 (12:26 +0000)
committerJouni Koivuviita <jouni.koivuviita@itmill.com>
Fri, 20 May 2011 12:26:01 +0000 (12:26 +0000)
svn changeset:18972/svn branch:6.6

src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java

index 932a54cd5be11a14cb63d2bdce607daacb5707b7..44870ef3507dad66058ac2b7ca60272b58a316f3 100644 (file)
@@ -90,12 +90,6 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
 
     private boolean openRootOnHover;
 
-    /*
-     * Flag to disable first root item selection when clicking on the menubar
-     * (tabbing to the menubar should select the first item)
-     */
-    private boolean preventFocusSelection = false;
-
     public VMenuBar() {
         // Create an empty horizontal menubar
         this(false, null);
@@ -486,7 +480,6 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
                     while (parent.getParentMenu() != null) {
                         parent = parent.getParentMenu();
                     }
-                    preventFocusSelection = true;
                     parent.setFocus(true);
                 }
 
@@ -511,7 +504,6 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
             while (parent.getParentMenu() != null) {
                 parent = parent.getParentMenu();
             }
-            preventFocusSelection = true;
             parent.setFocus(true);
         }
     }
@@ -561,9 +553,7 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
      * @param item
      */
     public void itemOver(CustomMenuItem item) {
-        preventFocusSelection = true;
         if ((openRootOnHover || subMenu || menuVisible) && !item.isSeparator()) {
-            preventFocusSelection = true;
             setSelected(item);
             if (!subMenu && openRootOnHover && !menuVisible) {
                 menuVisible = true; // start opening menus
@@ -1442,19 +1432,7 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
      * .dom.client.FocusEvent)
      */
     public void onFocus(FocusEvent event) {
-        if (!preventFocusSelection) {
-            setSelected(items.get(0));
-        }
-        preventFocusSelection = false;
-    }
 
-    @Override
-    public void setFocus(boolean focus) {
-        super.setFocus(focus);
-        if (!focus) {
-            setSelected(null);
-            preventFocusSelection = false;
-        }
     }
 
     private final String SUBPART_PREFIX = "item";