@@ -113,14 +113,14 @@ SideTab.prototype = {
113113 this . _hostView . innerText = this . host ;
114114 } ,
115115 _updateAudible ( audible ) {
116- toggleClass ( this . _iconOverlayView , "sound" , audible ) ;
116+ this . _iconOverlayView . classList . toggle ( "sound" , audible ) ;
117117 } ,
118118 _updatedMuted ( muted ) {
119119 this . muted = muted ;
120- toggleClass ( this . _iconOverlayView , "muted" , muted ) ;
120+ this . _iconOverlayView . classList . toggle ( "muted" , muted ) ;
121121 } ,
122122 _updateLoading ( isLoading ) {
123- toggleClass ( this . view , "loading" , isLoading ) ;
123+ this . view . classList . toggle ( "loading" , isLoading ) ;
124124 if ( isLoading ) {
125125 SideTab . _syncThrobberAnimations ( ) ;
126126 this . _notselectedsinceload = ! this . view . classList . contains ( "active" ) ;
@@ -136,7 +136,7 @@ SideTab.prototype = {
136136 this . _burstView . classList . add ( "bursting" ) ;
137137 } ,
138138 updateActive ( active ) {
139- toggleClass ( this . view , "active" , active ) ;
139+ this . view . classList . toggle ( "active" , active ) ;
140140 if ( active ) {
141141 this . _notselectedsinceload = false ;
142142 this . view . removeAttribute ( "notselectedsinceload" ) ;
@@ -166,7 +166,7 @@ SideTab.prototype = {
166166 } ,
167167 updateVisibility ( show ) {
168168 this . visible = show ;
169- toggleClass ( this . view , "hidden" , ! show ) ;
169+ this . view . classList . toggle ( "hidden" , ! show ) ;
170170 } ,
171171 _setIcon ( favIconUrl ) {
172172 // https://bugzilla.mozilla.org/show_bug.cgi?id=1462948
@@ -191,10 +191,10 @@ SideTab.prototype = {
191191 } ,
192192 _updatePinned ( pinned ) {
193193 this . pinned = pinned ;
194- toggleClass ( this . view , "pinned" , pinned ) ;
194+ this . view . classList . toggle ( "pinned" , pinned ) ;
195195 } ,
196196 _updateDiscarded ( discarded ) {
197- toggleClass ( this . view , "discarded" , discarded ) ;
197+ this . view . classList . toggle ( "discarded" , discarded ) ;
198198 } ,
199199 _updateThumbnail ( ) {
200200 requestIdleCallback ( async ( ) => {
@@ -345,8 +345,4 @@ function debounce(fn, delay) {
345345 } ;
346346}
347347
348- function toggleClass ( node , className , boolean ) {
349- boolean ? node . classList . add ( className ) : node . classList . remove ( className ) ;
350- }
351-
352348export default SideTab ;
0 commit comments