mirror of
https://github.com/nasa/openmct.git
synced 2025-01-31 16:36:13 +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() {
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
@ -52,9 +52,18 @@ define([
|
||||
layoutObject: domainObject
|
||||
},
|
||||
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) {
|
||||
component.$destroy();
|
||||
component = undefined;
|
||||
|
@ -31,7 +31,7 @@
|
||||
<browse-bar class="l-shell__main-view-browse-bar"
|
||||
ref="browseBar">
|
||||
</browse-bar>
|
||||
<toolbar class="l-shell__toolbar"></toolbar>
|
||||
<toolbar v-if="toolbar" class="l-shell__toolbar"></toolbar>
|
||||
<object-view class="l-shell__main-container"
|
||||
ref="browseObject">
|
||||
</object-view>
|
||||
@ -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() {
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user