Fixed the issue with adding and removing flex container (#13480)

This commit is contained in:
Leila Lali
2020-11-19 09:19:39 -08:00
committed by GitHub
parent ddd0b8b4bc
commit 870ff39527

View File

@@ -229,6 +229,7 @@ export class DashboardWidget {
iconHeight: '10px',
iconWidth: '10px'
}).component();
showMoreComponent.onDidClick(() => {
let showMore = showMoreComponent.label === constants.showMoreTitle;
if (showMore) {
@@ -237,12 +238,10 @@ export class DashboardWidget {
dark: this.asAbsolutePath('images/dark/showLess_inverse.svg'),
light: this.asAbsolutePath('images/light/showLess.svg'),
};
parentPanel.addItem(morePanel, {
CSSStyles: morePanelStyle
});
morePanel.updateCssStyles(Object.assign({}, morePanelStyle, { 'visibility': 'visible' }));
} else {
showMoreComponent.label = constants.showMoreTitle;
parentPanel.removeItem(morePanel);
morePanel.updateCssStyles(Object.assign({}, morePanelStyle, { 'visibility': 'hidden' }));
image.iconPath = {
dark: this.asAbsolutePath('images/dark/showMore_inverse.svg'),
light: this.asAbsolutePath('images/light/showMore.svg'),
@@ -267,6 +266,9 @@ export class DashboardWidget {
parentPanel.addItem(linkContainer, {
CSSStyles: {}
});
parentPanel.addItem(morePanel, {
CSSStyles: (Object.assign({}, morePanelStyle, { 'visibility': 'hidden' }))
});
return showMoreComponent;
}