mirror of
https://github.com/nasa/openmct.git
synced 2025-06-18 15:18:12 +00:00
[Menus] Reposition context menus correctly
Fix styles used to reposition context menus when they are near the edge of the screen, so that these menus remain both on-screen and near the user's mouse. WTD-719.
This commit is contained in:
@ -59,10 +59,14 @@ define(
|
||||
scope.domainObject = domainObject;
|
||||
scope.menuStyle = {};
|
||||
scope.menuStyle[goLeft ? "right" : "left"] =
|
||||
eventCoors[0] + 'px';
|
||||
(goLeft ? (winDim[0] - eventCoors[0]) : eventCoors[0]) + 'px';
|
||||
scope.menuStyle[goUp ? "bottom" : "top"] =
|
||||
eventCoors[1] + 'px';
|
||||
scope.menuClass = { "go-left": goLeft, "go-up": goUp, "context-menu-holder": true };
|
||||
(goUp ? (winDim[1] - eventCoors[1]) : eventCoors[1]) + 'px';
|
||||
scope.menuClass = {
|
||||
"go-left": goLeft,
|
||||
"go-up": goUp,
|
||||
"context-menu-holder": true
|
||||
};
|
||||
|
||||
// Create the context menu
|
||||
menu = $compile(MENU_TEMPLATE)(scope);
|
||||
|
Reference in New Issue
Block a user