diff --git a/src/adapter/gestures/AdaptedContextMenuGesture.js b/src/adapter/gestures/AdaptedContextMenuGesture.js index 08ec05ab12..217260fb84 100644 --- a/src/adapter/gestures/AdaptedContextMenuGesture.js +++ b/src/adapter/gestures/AdaptedContextMenuGesture.js @@ -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; diff --git a/src/selection/ContextManager.js b/src/selection/ContextManager.js index 856af07edc..d75f227a8b 100644 --- a/src/selection/ContextManager.js +++ b/src/selection/ContextManager.js @@ -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); } diff --git a/src/ui/menu/ContextMenuGesture.js b/src/ui/menu/ContextMenuGesture.js index bc6a52dfb7..0abfe1101f 100644 --- a/src/ui/menu/ContextMenuGesture.js +++ b/src/ui/menu/ContextMenuGesture.js @@ -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);