mirror of
https://github.com/nasa/openmct.git
synced 2025-01-21 03:55:31 +00:00
[Selection] Wire in new contextmenu
This commit is contained in:
parent
db41f6e64f
commit
235032a571
@ -1,7 +1,7 @@
|
||||
define(
|
||||
function () {
|
||||
function AdaptedContextMenuGesture(openmct, element, domainObject) {
|
||||
this.destroy = openmct.gestures.contextMenu(element, domainObject);
|
||||
function AdaptedContextMenuGesture(openmct, $els, domainObject) {
|
||||
this.destroy = openmct.gestures.contextual($els[0], domainObject);
|
||||
}
|
||||
|
||||
return AdaptedContextMenuGesture;
|
||||
|
@ -45,7 +45,7 @@ define(['zepto'], function ($) {
|
||||
|
||||
$element.attr('data-context', id);
|
||||
|
||||
if (this.contexts[id].item !== item) {
|
||||
if (this.contexts[id] && this.contexts[id].item !== item) {
|
||||
this.release(htmlElement);
|
||||
}
|
||||
|
||||
|
@ -18,14 +18,13 @@ define(['zepto', './ContextMenuView'], function ($, ContextMenuView) {
|
||||
var contextManager = this.contextManager;
|
||||
|
||||
var $element = $(htmlElement);
|
||||
var path = contextManager.path(item, htmlElement);
|
||||
var context = contextManager.context(item, htmlElement);
|
||||
|
||||
function showMenu(event) {
|
||||
selection.add(path);
|
||||
selection.add(context);
|
||||
|
||||
var x = event.clientX;
|
||||
var y = event.clientY;
|
||||
var context = selection.context();
|
||||
var actions = actionRegistry.get(context);
|
||||
var view = new ContextMenuView(actions);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user