mirror of
https://github.com/nasa/openmct.git
synced 2024-12-23 15:02:23 +00:00
Avoid using the same separator object when adding separators to toolbar (#2362)
This commit is contained in:
parent
3b0605d17b
commit
b7fa5c7ba8
@ -42,12 +42,7 @@ function ToolbarProvider(openmct) {
|
|||||||
toggleContainer,
|
toggleContainer,
|
||||||
deleteContainer,
|
deleteContainer,
|
||||||
addContainer,
|
addContainer,
|
||||||
toggleFrame,
|
toggleFrame;
|
||||||
separator;
|
|
||||||
|
|
||||||
separator = {
|
|
||||||
control: "separator"
|
|
||||||
};
|
|
||||||
|
|
||||||
toggleContainer = {
|
toggleContainer = {
|
||||||
control: 'toggle-button',
|
control: 'toggle-button',
|
||||||
@ -68,6 +63,12 @@ function ToolbarProvider(openmct) {
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function getSeparator() {
|
||||||
|
return {
|
||||||
|
control: "separator"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if (primary.context.type === 'frame') {
|
if (primary.context.type === 'frame') {
|
||||||
let frameId = primary.context.frameId;
|
let frameId = primary.context.frameId;
|
||||||
let layoutObject = tertiary.context.item;
|
let layoutObject = tertiary.context.item;
|
||||||
@ -201,9 +202,9 @@ function ToolbarProvider(openmct) {
|
|||||||
let toolbar = [
|
let toolbar = [
|
||||||
toggleContainer,
|
toggleContainer,
|
||||||
addContainer,
|
addContainer,
|
||||||
toggleFrame ? separator : undefined,
|
toggleFrame ? getSeparator() : undefined,
|
||||||
toggleFrame,
|
toggleFrame,
|
||||||
deleteFrame || deleteContainer ? separator : undefined,
|
deleteFrame || deleteContainer ? getSeparator() : undefined,
|
||||||
deleteFrame,
|
deleteFrame,
|
||||||
deleteContainer
|
deleteContainer
|
||||||
];
|
];
|
||||||
|
Loading…
Reference in New Issue
Block a user