From 9ce9d6267234d31c44172f31ca295bef259c843e Mon Sep 17 00:00:00 2001 From: Yuriy Artamonov Date: Mon, 13 Feb 2012 12:30:36 +0000 Subject: [PATCH] Refs #1084 Do not hide menus by click on menu item with sub menu --- .../com/vaadin/terminal/gwt/client/ui/VMenuBar.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/web-toolkit/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java b/modules/web-toolkit/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java index f1a48dceb6..034c8a2046 100644 --- a/modules/web-toolkit/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java +++ b/modules/web-toolkit/src/com/vaadin/terminal/gwt/client/ui/VMenuBar.java @@ -742,16 +742,18 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, * Shows the child menu of an item. The caller must ensure that the item has * a submenu. * - * @param item + * @param item Menu item */ public void showChildMenu(CustomMenuItem item) { - popup = new VOverlay(false, false, true); + popup = new VOverlay(true, false, true); //sets Id for popup if Ids in DOM are available client.setElementId(popup.getElement(), getDebugId()); popup.setWidget(item.getSubMenu()); popup.addCloseHandler(this); + popup.addAutoHidePartner(this.getElement()); + popup.addAutoHidePartner(item.getElement()); if (subMenu) { popup.setPopupPosition(item.getParentMenu().getAbsoluteLeft() @@ -781,7 +783,7 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, return debugId; } - protected void showChildMenuAt(CustomMenuItem item, int top, int left) { + /*protected void showChildMenuAt(CustomMenuItem item, int top, int left) { final int shadowSpace = 10; popup = new VOverlay(true, false, true); @@ -837,11 +839,11 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable, }); } } - +*/ /** * Hides the submenu of an item * - * @param item + * @param item Menu item */ public void hideChildMenu(CustomMenuItem item) { if (visibleChildMenu != null