Avoid using the same separator object when adding separators to toolbar (#2362)

This commit is contained in:
Pegah Sarram 2019-04-06 17:04:52 -07:00 committed by Deep Tailor
parent 3b0605d17b
commit b7fa5c7ba8

View File

@ -42,12 +42,7 @@ function ToolbarProvider(openmct) {
toggleContainer,
deleteContainer,
addContainer,
toggleFrame,
separator;
separator = {
control: "separator"
};
toggleFrame;
toggleContainer = {
control: 'toggle-button',
@ -68,6 +63,12 @@ function ToolbarProvider(openmct) {
]
};
function getSeparator() {
return {
control: "separator"
};
}
if (primary.context.type === 'frame') {
let frameId = primary.context.frameId;
let layoutObject = tertiary.context.item;
@ -201,9 +202,9 @@ function ToolbarProvider(openmct) {
let toolbar = [
toggleContainer,
addContainer,
toggleFrame ? separator : undefined,
toggleFrame ? getSeparator() : undefined,
toggleFrame,
deleteFrame || deleteContainer ? separator : undefined,
deleteFrame || deleteContainer ? getSeparator() : undefined,
deleteFrame,
deleteContainer
];