mirror of
https://github.com/nasa/openmct.git
synced 2025-06-15 21:58:13 +00:00
pass correct object path, and remove notebook snapshot button from preview
This commit is contained in:
@ -217,18 +217,16 @@ export default {
|
|||||||
populateActionMenu() {
|
populateActionMenu() {
|
||||||
const self = this;
|
const self = this;
|
||||||
const actions = [new PreviewAction(self.openmct)];
|
const actions = [new PreviewAction(self.openmct)];
|
||||||
self.openmct.objects.get(self.embed.type)
|
|
||||||
.then((domainObject) => {
|
actions.forEach((action) => {
|
||||||
actions.forEach((action) => {
|
self.actions.push({
|
||||||
self.actions.push({
|
cssClass: action.cssClass,
|
||||||
cssClass: action.cssClass,
|
name: action.name,
|
||||||
name: action.name,
|
perform: () => {
|
||||||
perform: () => {
|
action.invoke(self.embed.objectPath);
|
||||||
action.invoke([domainObject].concat(self.openmct.router.path));
|
}
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
removeEmbed(id) {
|
removeEmbed(id) {
|
||||||
this.$emit('removeEmbed', id);
|
this.$emit('removeEmbed', id);
|
||||||
|
@ -95,7 +95,8 @@ export const createNewEmbed = (snapshotMeta, snapshot = '') => {
|
|||||||
id: 'embed-' + date,
|
id: 'embed-' + date,
|
||||||
name,
|
name,
|
||||||
snapshot,
|
snapshot,
|
||||||
type
|
type,
|
||||||
|
objectPath
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,12 +40,6 @@
|
|||||||
:current-view="currentView"
|
:current-view="currentView"
|
||||||
@setView="setView"
|
@setView="setView"
|
||||||
/>
|
/>
|
||||||
<button
|
|
||||||
v-if="notebookEnabled"
|
|
||||||
class="l-browse-bar__actions__edit c-button icon-notebook"
|
|
||||||
title="New Notebook entry"
|
|
||||||
@click="snapshot"
|
|
||||||
></button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -57,7 +51,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import ContextMenuDropDown from '../../ui/components/contextMenuDropDown.vue';
|
import ContextMenuDropDown from '../../ui/components/contextMenuDropDown.vue';
|
||||||
import Snapshot from '@/plugins/notebook/snapshot';
|
|
||||||
import ViewSwitcher from '../../ui/layout/ViewSwitcher.vue';
|
import ViewSwitcher from '../../ui/layout/ViewSwitcher.vue';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
@ -94,20 +87,11 @@ export default {
|
|||||||
mounted() {
|
mounted() {
|
||||||
let view = this.openmct.objectViews.get(this.domainObject)[0];
|
let view = this.openmct.objectViews.get(this.domainObject)[0];
|
||||||
this.setView(view);
|
this.setView(view);
|
||||||
|
|
||||||
if (this.openmct.types.get('notebook')) {
|
|
||||||
this.notebookSnapshot = new Snapshot(this.openmct);
|
|
||||||
this.notebookEnabled = true;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
destroyed() {
|
destroyed() {
|
||||||
this.view.destroy();
|
this.view.destroy();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
snapshot() {
|
|
||||||
let element = document.getElementsByClassName("l-preview-window__object-view")[0];
|
|
||||||
this.notebookSnapshot.capture(this.domainObject, element);
|
|
||||||
},
|
|
||||||
clear() {
|
clear() {
|
||||||
if (this.view) {
|
if (this.view) {
|
||||||
this.view.destroy();
|
this.view.destroy();
|
||||||
|
Reference in New Issue
Block a user