conditionally enable notebook button in preview (#2373)

This commit is contained in:
Deep Tailor 2019-04-10 15:45:02 -07:00 committed by Pegah Sarram
parent 3219a64d09
commit 9c9006d415

View File

@ -33,7 +33,8 @@
</div> </div>
<div class="l-browse-bar__end"> <div class="l-browse-bar__end">
<div class="l-browse-bar__actions"> <div class="l-browse-bar__actions">
<button class="l-browse-bar__actions__edit c-button icon-notebook" <button v-if="notebookEnabled"
class="l-browse-bar__actions__edit c-button icon-notebook"
title="New Notebook entry" title="New Notebook entry"
@click="snapshot"> @click="snapshot">
</button> </button>
@ -101,14 +102,19 @@
return { return {
domainObject: domainObject, domainObject: domainObject,
type: type type: type,
notebookEnabled: false
}; };
}, },
mounted() { mounted() {
let viewProvider = this.openmct.objectViews.get(this.domainObject)[0]; let viewProvider = this.openmct.objectViews.get(this.domainObject)[0];
this.view = viewProvider.view(this.domainObject); this.view = viewProvider.view(this.domainObject);
this.view.show(this.$refs.objectView, false); this.view.show(this.$refs.objectView, false);
this.notebookSnapshot = new NotebookSnapshot(this.openmct);
if (this.openmct.types.get('notebook')) {
this.notebookSnapshot = new NotebookSnapshot(this.openmct);
this.notebookEnabled = true;
}
}, },
destroy() { destroy() {
this.view.destroy(); this.view.destroy();