mirror of
https://github.com/nasa/openmct.git
synced 2025-01-01 19:06:40 +00:00
[Menus] Dismiss menu when clicked
Addresses WTD-1506 (context menu does not disappear after action is chosen); listen for click events on the menu itself and dismiss the menu when these occur.
This commit is contained in:
parent
7ded288154
commit
87aa0cfce2
@ -31,7 +31,8 @@ define(
|
||||
|
||||
var MENU_TEMPLATE = "<mct-representation key=\"'context-menu'\" " +
|
||||
"mct-object=\"domainObject\" " +
|
||||
"ng-class=\"menuClass\"" +
|
||||
"ng-click=\"dismiss()\" " +
|
||||
"ng-class=\"menuClass\" " +
|
||||
"ng-style=\"menuStyle\">" +
|
||||
"</mct-representation>",
|
||||
dismissExistingMenu;
|
||||
@ -62,7 +63,7 @@ define(
|
||||
// Remove the context menu
|
||||
function dismiss() {
|
||||
menu.remove();
|
||||
body.off("click", dismiss);
|
||||
body.off("mousedown", dismiss);
|
||||
dismissExistingMenu = undefined;
|
||||
}
|
||||
|
||||
@ -86,6 +87,7 @@ define(
|
||||
"go-up": goUp,
|
||||
"context-menu-holder": true
|
||||
};
|
||||
scope.dismiss = dismiss;
|
||||
|
||||
// Create the context menu
|
||||
menu = $compile(MENU_TEMPLATE)(scope);
|
||||
|
Loading…
Reference in New Issue
Block a user