[Selection] Wire in new contextmenu

This commit is contained in:
Victor Woeltjen 2016-09-23 15:27:39 -07:00
parent db41f6e64f
commit 235032a571
3 changed files with 5 additions and 6 deletions

View File

@ -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;

View File

@ -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);
}

View File

@ -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);