mirror of
https://gitee.com/jmix/cuba.git
synced 2024-12-04 12:17:41 +08:00
Refs #1084 Do not hide menus by click on menu item with sub menu
This commit is contained in:
parent
f0334ca9c8
commit
9ce9d62672
@ -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
|
* Shows the child menu of an item. The caller must ensure that the item has
|
||||||
* a submenu.
|
* a submenu.
|
||||||
*
|
*
|
||||||
* @param item
|
* @param item Menu item
|
||||||
*/
|
*/
|
||||||
public void showChildMenu(CustomMenuItem 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
|
//sets Id for popup if Ids in DOM are available
|
||||||
client.setElementId(popup.getElement(), getDebugId());
|
client.setElementId(popup.getElement(), getDebugId());
|
||||||
|
|
||||||
popup.setWidget(item.getSubMenu());
|
popup.setWidget(item.getSubMenu());
|
||||||
popup.addCloseHandler(this);
|
popup.addCloseHandler(this);
|
||||||
|
popup.addAutoHidePartner(this.getElement());
|
||||||
|
popup.addAutoHidePartner(item.getElement());
|
||||||
|
|
||||||
if (subMenu) {
|
if (subMenu) {
|
||||||
popup.setPopupPosition(item.getParentMenu().getAbsoluteLeft()
|
popup.setPopupPosition(item.getParentMenu().getAbsoluteLeft()
|
||||||
@ -781,7 +783,7 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
|
|||||||
return debugId;
|
return debugId;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void showChildMenuAt(CustomMenuItem item, int top, int left) {
|
/*protected void showChildMenuAt(CustomMenuItem item, int top, int left) {
|
||||||
final int shadowSpace = 10;
|
final int shadowSpace = 10;
|
||||||
|
|
||||||
popup = new VOverlay(true, false, true);
|
popup = new VOverlay(true, false, true);
|
||||||
@ -837,11 +839,11 @@ public class VMenuBar extends SimpleFocusablePanel implements Paintable,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/**
|
/**
|
||||||
* Hides the submenu of an item
|
* Hides the submenu of an item
|
||||||
*
|
*
|
||||||
* @param item
|
* @param item Menu item
|
||||||
*/
|
*/
|
||||||
public void hideChildMenu(CustomMenuItem item) {
|
public void hideChildMenu(CustomMenuItem item) {
|
||||||
if (visibleChildMenu != null
|
if (visibleChildMenu != null
|
||||||
|
Loading…
Reference in New Issue
Block a user