@@ -128,13 +128,15 @@ function createTimeRangeUI(labelText, initialValue, unit = "ms", min = 0, max =
128128function createUIForSuites ( ) {
129129 const control = document . createElement ( "nav" ) ;
130130 control . className = "suites" ;
131- const ol = document . createElement ( "ol" ) ;
132131 const checkboxes = [ ] ;
133132 const setSuiteEnabled = ( suiteIndex , enabled ) => {
134133 Suites [ suiteIndex ] . disabled = ! enabled ;
135134 checkboxes [ suiteIndex ] . checked = enabled ;
136135 } ;
137136
137+ control . appendChild ( createSuitesGlobalSelectButtons ( setSuiteEnabled ) ) ;
138+
139+ const ol = document . createElement ( "ol" ) ;
138140 for ( const suite of Suites ) {
139141 const li = document . createElement ( "li" ) ;
140142 const checkbox = document . createElement ( "input" ) ;
@@ -164,7 +166,12 @@ function createUIForSuites() {
164166 ol . appendChild ( li ) ;
165167 }
166168 control . appendChild ( ol ) ;
167- let buttons = control . appendChild ( document . createElement ( "div" ) ) ;
169+ control . appendChild ( createSuitesTagsButton ( setSuiteEnabled ) ) ;
170+ return control ;
171+ }
172+
173+ function createSuitesGlobalSelectButtons ( setSuiteEnabled ) {
174+ const buttons = document . createElement ( "div" ) ;
168175 buttons . className = "button-bar" ;
169176
170177 let button = document . createElement ( "button" ) ;
@@ -186,18 +193,24 @@ function createUIForSuites() {
186193 updateURL ( ) ;
187194 } ;
188195 buttons . appendChild ( button ) ;
196+ return buttons ;
197+ }
189198
199+ function createSuitesTagsButton ( setSuiteEnabled ) {
200+ let tags = document . createElement ( "div" ) ;
201+ let buttons = tags . appendChild ( document . createElement ( "div" ) ) ;
202+ buttons . className = "button-bar" ;
190203 let i = 0 ;
191204 const kTagsPerLine = 3 ;
192205 for ( const tag of Tags ) {
193206 if ( tag === "all" )
194207 continue ;
195208 if ( ! ( i % kTagsPerLine ) ) {
196- buttons = control . appendChild ( document . createElement ( "div" ) ) ;
209+ buttons = tags . appendChild ( document . createElement ( "div" ) ) ;
197210 buttons . className = "button-bar" ;
198211 }
199212 i ++ ;
200- button = document . createElement ( "button" ) ;
213+ const button = document . createElement ( "button" ) ;
201214 button . className = "tag" ;
202215 button . textContent = `#${ tag } ` ;
203216 button . dataTag = tag ;
@@ -217,8 +230,7 @@ function createUIForSuites() {
217230 } ;
218231 buttons . appendChild ( button ) ;
219232 }
220-
221- return control ;
233+ return tags ;
222234}
223235
224236function createUIForRun ( ) {
0 commit comments