diff --git a/platform/commonUI/inspect/src/gestures/InfoButtonGesture.js b/platform/commonUI/inspect/src/gestures/InfoButtonGesture.js index 81a3fd9e84..045202aa7a 100644 --- a/platform/commonUI/inspect/src/gestures/InfoButtonGesture.js +++ b/platform/commonUI/inspect/src/gestures/InfoButtonGesture.js @@ -38,7 +38,6 @@ define( function InfoGestureButton($document, agentService, infoService, element, domainObject) { var dismissBubble, touchPosition, - scopeOff, body = $document.find('body'); function trackPosition(event) { @@ -94,10 +93,6 @@ define( element.on('click', showBubble); } - // Also make sure we dismiss bubble if representation is destroyed - // before the mouse actually leaves it - scopeOff = element.scope().$on('$destroy', hideBubble); - return { /** * Detach any event handlers associated with this gesture. @@ -109,7 +104,6 @@ define( hideBubble(); // ...and detach listeners element.off('click', showBubble); - scopeOff(); } }; } diff --git a/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js b/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js index 781bfd3769..5be65650cb 100644 --- a/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js +++ b/platform/commonUI/inspect/test/gestures/InfoButtonGestureSpec.js @@ -137,6 +137,11 @@ define( ); }); + // https://github.com/nasa/openmct/issues/948 + it("does not try to access scope", function () { + expect(mockElement.scope).not.toHaveBeenCalled(); + }); + }); } );