Remove calls to DOM.addClass and DOM.removeClass (#13063)

This commit is contained in:
Charles Gagnon
2020-10-23 14:42:22 -07:00
committed by GitHub
parent c7ab69d46d
commit 2d182fcd03
24 changed files with 89 additions and 93 deletions

View File

@@ -301,16 +301,16 @@ export class ProfilerEditor extends EditorPane {
profilerTableContainer.style.position = 'relative';
let theme = this.themeService.getColorTheme();
if (theme.type === ColorScheme.DARK) {
DOM.addClass(profilerTableContainer, VS_DARK_THEME);
profilerTableContainer.classList.add(VS_DARK_THEME);
} else if (theme.type === ColorScheme.HIGH_CONTRAST) {
DOM.addClass(profilerTableContainer, VS_HC_THEME);
profilerTableContainer.classList.add(VS_HC_THEME);
}
this.themeService.onDidColorThemeChange(e => {
DOM.removeClasses(profilerTableContainer, VS_DARK_THEME, VS_HC_THEME);
if (e.type === ColorScheme.DARK) {
DOM.addClass(profilerTableContainer, VS_DARK_THEME);
profilerTableContainer.classList.add(VS_DARK_THEME);
} else if (e.type === ColorScheme.HIGH_CONTRAST) {
DOM.addClass(profilerTableContainer, VS_HC_THEME);
profilerTableContainer.classList.add(VS_HC_THEME);
}
});
this._profilerTableEditor = this._instantiationService.createInstance(ProfilerTableEditor);

View File

@@ -260,12 +260,12 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
this._updateButtons();
setTimeout(() => {
dom.addClass(this._domNode, 'visible');
this._domNode.classList.add('visible');
this._domNode.setAttribute('aria-hidden', 'false');
if (!animate) {
dom.addClass(this._domNode, 'noanimation');
this._domNode.classList.add('noanimation');
setTimeout(() => {
dom.removeClass(this._domNode, 'noanimation');
this._domNode.classList.remove('noanimation');
}, 200);
}
}, 0);
@@ -279,7 +279,7 @@ export class FindWidget extends Widget implements IOverlayWidget, IVerticalSashL
this._updateButtons();
dom.removeClass(this._domNode, 'visible');
this._domNode.classList.remove('visible');
this._domNode.setAttribute('aria-hidden', 'true');
if (focusTheEditor) {
this._tableController.focus();