mirror of
https://github.com/nasa/openmct.git
synced 2025-05-30 06:04:20 +00:00
[Toolbar] hide toolbar when in browse mode (#2278)
* Hide toolbar when not editing and the selected object has no toolbar. * Remove unused code
This commit is contained in:
parent
baa5d10009
commit
1dc1cc6c24
@ -588,20 +588,9 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
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);
|
this.unobserve = this.openmct.objects.observe(this.domainObject, '*', this.updateDomainObject);
|
||||||
},
|
},
|
||||||
beforeDestroy() {
|
beforeDestroy() {
|
||||||
this.unsubscribeSelection();
|
|
||||||
this.unobserve();
|
this.unobserve();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,9 +52,18 @@ define([
|
|||||||
layoutObject: domainObject
|
layoutObject: domainObject
|
||||||
},
|
},
|
||||||
el: element,
|
el: element,
|
||||||
template: '<flexible-layout-component></flexible-layout-component>'
|
template: '<flexible-layout-component ref="flexibleLayout"></flexible-layout-component>'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
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) {
|
destroy: function (element) {
|
||||||
component.$destroy();
|
component.$destroy();
|
||||||
component = undefined;
|
component = undefined;
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
<browse-bar class="l-shell__main-view-browse-bar"
|
<browse-bar class="l-shell__main-view-browse-bar"
|
||||||
ref="browseBar">
|
ref="browseBar">
|
||||||
</browse-bar>
|
</browse-bar>
|
||||||
<toolbar class="l-shell__toolbar"></toolbar>
|
<toolbar v-if="toolbar" class="l-shell__toolbar"></toolbar>
|
||||||
<object-view class="l-shell__main-container"
|
<object-view class="l-shell__main-container"
|
||||||
ref="browseObject">
|
ref="browseObject">
|
||||||
</object-view>
|
</object-view>
|
||||||
@ -312,6 +312,20 @@
|
|||||||
isEditing: false
|
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: {
|
methods: {
|
||||||
fullScreenToggle() {
|
fullScreenToggle() {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user