mirror of
https://github.com/nasa/openmct.git
synced 2025-06-16 14:18:16 +00:00
fix errors when navigated away from a layout that uses toolbar
This commit is contained in:
@ -520,6 +520,10 @@ define(['lodash'], function (_) {
|
|||||||
let selectedParent = selectionPath[1].context.item;
|
let selectedParent = selectionPath[1].context.item;
|
||||||
let layoutItem = selectionPath[0].context.layoutItem;
|
let layoutItem = selectionPath[0].context.layoutItem;
|
||||||
|
|
||||||
|
if (!layoutItem) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (layoutItem.type === 'subobject-view') {
|
if (layoutItem.type === 'subobject-view') {
|
||||||
if (toolbar['add-menu'].length === 0 && selectionPath[0].context.item.type === 'layout') {
|
if (toolbar['add-menu'].length === 0 && selectionPath[0].context.item.type === 'layout') {
|
||||||
toolbar['add-menu'] = [getAddButton(selectedObjects, selectionPath)];
|
toolbar['add-menu'] = [getAddButton(selectedObjects, selectionPath)];
|
||||||
|
@ -85,7 +85,13 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
let format = selection[0][0].context.layoutItem.format;
|
let layoutItem = selection[0][0].context.layoutItem;
|
||||||
|
|
||||||
|
if (!layoutItem) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
let format = layoutItem.format;
|
||||||
this.nonMixedFormat = selection.every(selectionPath => {
|
this.nonMixedFormat = selection.every(selectionPath => {
|
||||||
return selectionPath[0].context.layoutItem.format === format;
|
return selectionPath[0].context.layoutItem.format === format;
|
||||||
});
|
});
|
||||||
|
@ -155,7 +155,7 @@ export default {
|
|||||||
return this.composition.load();
|
return this.composition.load();
|
||||||
},
|
},
|
||||||
getSelectionContext() {
|
getSelectionContext() {
|
||||||
if (this.currentView.getSelectionContext) {
|
if (this.currentView && this.currentView.getSelectionContext) {
|
||||||
return this.currentView.getSelectionContext();
|
return this.currentView.getSelectionContext();
|
||||||
} else {
|
} else {
|
||||||
return { item: this.currentObject };
|
return { item: this.currentObject };
|
||||||
|
Reference in New Issue
Block a user