@@ -8,7 +8,7 @@ import { EditorGroup, IEditorOpenOptions, EditorCloseEvent, ISerializedEditorGro
88import { EditorInput , EditorOptions , GroupIdentifier , SideBySideEditorInput , CloseDirection , IEditorCloseEvent , ActiveEditorDirtyContext , IEditorPane , EditorGroupEditorsCountContext , SaveReason , IEditorPartOptionsChangeEvent , EditorsOrder , IVisibleEditorPane , ActiveEditorStickyContext , ActiveEditorPinnedContext , Deprecated_EditorPinnedContext , Deprecated_EditorDirtyContext } from 'vs/workbench/common/editor' ;
99import { Event , Emitter , Relay } from 'vs/base/common/event' ;
1010import { IInstantiationService , ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
11- import { addClass , addClasses , Dimension , trackFocus , toggleClass , removeClass , addDisposableListener , EventType , EventHelper , findParentWithClass , clearNode , isAncestor } from 'vs/base/browser/dom' ;
11+ import { Dimension , trackFocus , addDisposableListener , EventType , EventHelper , findParentWithClass , clearNode , isAncestor } from 'vs/base/browser/dom' ;
1212import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection' ;
1313import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
1414import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar' ;
@@ -150,7 +150,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
150150 //#region create()
151151 {
152152 // Container
153- addClasses ( this . element , 'editor-group-container' ) ;
153+ this . element . classList . add ( 'editor-group-container' ) ;
154154
155155 // Container listeners
156156 this . registerContainerListeners ( ) ;
@@ -163,7 +163,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
163163
164164 // Letterpress container
165165 const letterpressContainer = document . createElement ( 'div' ) ;
166- addClass ( letterpressContainer , 'editor-group-letterpress' ) ;
166+ letterpressContainer . classList . add ( 'editor-group-letterpress' ) ;
167167 this . element . appendChild ( letterpressContainer ) ;
168168
169169 // Progress bar
@@ -183,15 +183,15 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
183183
184184 // Title container
185185 this . titleContainer = document . createElement ( 'div' ) ;
186- addClass ( this . titleContainer , 'title' ) ;
186+ this . titleContainer . classList . add ( 'title' ) ;
187187 this . element . appendChild ( this . titleContainer ) ;
188188
189189 // Title control
190190 this . titleAreaControl = this . createTitleAreaControl ( ) ;
191191
192192 // Editor container
193193 this . editorContainer = document . createElement ( 'div' ) ;
194- addClass ( this . editorContainer , 'editor-container' ) ;
194+ this . editorContainer . classList . add ( 'editor-container' ) ;
195195 this . element . appendChild ( this . editorContainer ) ;
196196
197197 // Editor control
@@ -296,7 +296,7 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
296296
297297 // Toolbar Container
298298 const toolbarContainer = document . createElement ( 'div' ) ;
299- addClass ( toolbarContainer , 'editor-group-container-toolbar' ) ;
299+ toolbarContainer . classList . add ( 'editor-group-container-toolbar' ) ;
300300 this . element . appendChild ( toolbarContainer ) ;
301301
302302 // Toolbar
@@ -403,14 +403,14 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
403403
404404 // Empty Container: add some empty container attributes
405405 if ( this . isEmpty ) {
406- addClass ( this . element , 'empty' ) ;
406+ this . element . classList . add ( 'empty' ) ;
407407 this . element . tabIndex = 0 ;
408408 this . element . setAttribute ( 'aria-label' , localize ( 'emptyEditorGroup' , "{0} (empty)" , this . label ) ) ;
409409 }
410410
411411 // Non-Empty Container: revert empty container attributes
412412 else {
413- removeClass ( this . element , 'empty' ) ;
413+ this . element . classList . remove ( 'empty' ) ;
414414 this . element . removeAttribute ( 'tabIndex' ) ;
415415 this . element . removeAttribute ( 'aria-label' ) ;
416416 }
@@ -420,8 +420,8 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
420420 }
421421
422422 private updateTitleContainer ( ) : void {
423- toggleClass ( this . titleContainer , 'tabs' , this . accessor . partOptions . showTabs ) ;
424- toggleClass ( this . titleContainer , 'show-file-icons' , this . accessor . partOptions . showIcons ) ;
423+ this . titleContainer . classList . toggle ( 'tabs' , this . accessor . partOptions . showTabs ) ;
424+ this . titleContainer . classList . toggle ( 'show-file-icons' , this . accessor . partOptions . showIcons ) ;
425425 }
426426
427427 private createTitleAreaControl ( ) : TitleControl {
@@ -731,8 +731,8 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
731731 this . active = isActive ;
732732
733733 // Update container
734- toggleClass ( this . element , 'active' , isActive ) ;
735- toggleClass ( this . element , 'inactive' , ! isActive ) ;
734+ this . element . classList . toggle ( 'active' , isActive ) ;
735+ this . element . classList . toggle ( 'inactive' , ! isActive ) ;
736736
737737 // Update title control
738738 this . titleAreaControl . setActive ( isActive ) ;
@@ -1662,10 +1662,10 @@ export class EditorGroupView extends Themable implements IEditorGroupView {
16621662 // Title control
16631663 const borderColor = this . getColor ( EDITOR_GROUP_HEADER_BORDER ) || this . getColor ( contrastBorder ) ;
16641664 if ( ! isEmpty && borderColor ) {
1665- addClass ( this . titleContainer , 'title-border-bottom' ) ;
1665+ this . titleContainer . classList . add ( 'title-border-bottom' ) ;
16661666 this . titleContainer . style . setProperty ( '--title-border-bottom-color' , borderColor . toString ( ) ) ;
16671667 } else {
1668- removeClass ( this . titleContainer , 'title-border-bottom' ) ;
1668+ this . titleContainer . classList . remove ( 'title-border-bottom' ) ;
16691669 this . titleContainer . style . removeProperty ( '--title-border-bottom-color' ) ;
16701670 }
16711671
0 commit comments