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, 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
]; ];