diff --git a/src/plugins/flexibleLayout/components/flexibleLayout.vue b/src/plugins/flexibleLayout/components/flexibleLayout.vue index 58f52d00d6..9a2ee5b9c6 100644 --- a/src/plugins/flexibleLayout/components/flexibleLayout.vue +++ b/src/plugins/flexibleLayout/components/flexibleLayout.vue @@ -588,20 +588,9 @@ export default { } }, mounted() { - - let context = { - item: this.domainObject, - addContainer: this.addContainer, - deleteContainer: this.deleteContainer, - deleteFrame: this.deleteFrame, - type: 'flexible-layout' - } - - this.unsubscribeSelection = this.openmct.selection.selectable(this.$el, context, true); this.unobserve = this.openmct.objects.observe(this.domainObject, '*', this.updateDomainObject); }, beforeDestroy() { - this.unsubscribeSelection(); this.unobserve(); } } diff --git a/src/plugins/flexibleLayout/flexibleLayoutViewProvider.js b/src/plugins/flexibleLayout/flexibleLayoutViewProvider.js index f981ba54a9..ef223577ab 100644 --- a/src/plugins/flexibleLayout/flexibleLayoutViewProvider.js +++ b/src/plugins/flexibleLayout/flexibleLayoutViewProvider.js @@ -52,9 +52,18 @@ define([ layoutObject: domainObject }, el: element, - template: '' + template: '' }); }, + getSelectionContext: function () { + return { + item: domainObject, + addContainer: component.$refs.flexibleLayout.addContainer, + deleteContainer: component.$refs.flexibleLayout.deleteContainer, + deleteFrame: component.$refs.flexibleLayout.deleteFrame, + type: 'flexible-layout' + }; + }, destroy: function (element) { component.$destroy(); component = undefined; diff --git a/src/ui/layout/Layout.vue b/src/ui/layout/Layout.vue index 8120ed350f..4f9886712f 100644 --- a/src/ui/layout/Layout.vue +++ b/src/ui/layout/Layout.vue @@ -31,7 +31,7 @@ - + @@ -312,6 +312,20 @@ isEditing: false } }, + computed: { + toolbar() { + let selection = this.openmct.selection.get(); + let structure = undefined; + + if (!selection[0]) { + structure = []; + } else { + structure = this.openmct.toolbars.get(selection); + } + + return this.isEditing && structure.length > 0; + } + }, methods: { fullScreenToggle() {