diff --git a/src/ui/preview/PreviewAction.js b/src/ui/preview/PreviewAction.js index 80ae046bd3..ff4bb70c81 100644 --- a/src/ui/preview/PreviewAction.js +++ b/src/ui/preview/PreviewAction.js @@ -36,7 +36,12 @@ export default class PreviewAction { * Dependencies */ this._openmct = openmct; + + if (PreviewAction.isVisible === undefined) { + PreviewAction.isVisible = false; + } } + invoke(objectPath) { let preview = new Vue({ components: { @@ -59,12 +64,19 @@ export default class PreviewAction { callback: () => overlay.dismiss() } ], - onDestroy: () => preview.$destroy() + onDestroy: () => { + PreviewAction.isVisible = false; + preview.$destroy() + } }); + + PreviewAction.isVisible = true; } + appliesTo(objectPath) { - return !this._isNavigatedObject(objectPath) && !this._preventPreview(objectPath); + return !PreviewAction.isVisible && !this._isNavigatedObject(objectPath); } + _isNavigatedObject(objectPath) { let targetObject = objectPath[0]; let navigatedObject = this._openmct.router.path[0];