mirror of
https://github.com/nasa/openmct.git
synced 2025-05-31 22:50:49 +00:00
if editing and styles tab is selected and it exists for the next item, keep it selected
This commit is contained in:
parent
4202de9f98
commit
f4f010ac4f
@ -80,7 +80,9 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateSelection() {
|
updateSelection() {
|
||||||
|
const previousSelectedTab = this.selectedTab?.key;
|
||||||
const inspectorViews = this.openmct.inspectorViews.get(this.openmct.selection.get());
|
const inspectorViews = this.openmct.inspectorViews.get(this.openmct.selection.get());
|
||||||
|
const isEditing = this.openmct.editor.isEditing();
|
||||||
|
|
||||||
this.tabs = inspectorViews.map((view) => {
|
this.tabs = inspectorViews.map((view) => {
|
||||||
return {
|
return {
|
||||||
@ -91,7 +93,13 @@ export default {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
this.selectTab(this.visibleTabs[0]);
|
const stylesTabIndex = this.tabs.findIndex((tab) => tab.key === 'stylesInspectorView');
|
||||||
|
|
||||||
|
if (isEditing && previousSelectedTab === 'stylesInspectorView' && stylesTabIndex !== -1) {
|
||||||
|
this.selectTab(this.tabs[stylesTabIndex]);
|
||||||
|
} else {
|
||||||
|
this.selectTab(this.visibleTabs[0]);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
isSelected(tab) {
|
isSelected(tab) {
|
||||||
return this.selectedTab?.key === tab.key;
|
return this.selectedTab?.key === tab.key;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user