@@ -128,13 +128,15 @@ function createTimeRangeUI(labelText, initialValue, unit = "ms", min = 0, max =
128
128
function createUIForSuites ( ) {
129
129
const control = document . createElement ( "nav" ) ;
130
130
control . className = "suites" ;
131
- const ol = document . createElement ( "ol" ) ;
132
131
const checkboxes = [ ] ;
133
132
const setSuiteEnabled = ( suiteIndex , enabled ) => {
134
133
Suites [ suiteIndex ] . disabled = ! enabled ;
135
134
checkboxes [ suiteIndex ] . checked = enabled ;
136
135
} ;
137
136
137
+ control . appendChild ( createSuitesGlobalSelectButtons ( setSuiteEnabled ) ) ;
138
+
139
+ const ol = document . createElement ( "ol" ) ;
138
140
for ( const suite of Suites ) {
139
141
const li = document . createElement ( "li" ) ;
140
142
const checkbox = document . createElement ( "input" ) ;
@@ -164,7 +166,12 @@ function createUIForSuites() {
164
166
ol . appendChild ( li ) ;
165
167
}
166
168
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" ) ;
168
175
buttons . className = "button-bar" ;
169
176
170
177
let button = document . createElement ( "button" ) ;
@@ -186,18 +193,24 @@ function createUIForSuites() {
186
193
updateURL ( ) ;
187
194
} ;
188
195
buttons . appendChild ( button ) ;
196
+ return buttons ;
197
+ }
189
198
199
+ function createSuitesTagsButton ( setSuiteEnabled ) {
200
+ let tags = document . createElement ( "div" ) ;
201
+ let buttons = tags . appendChild ( document . createElement ( "div" ) ) ;
202
+ buttons . className = "button-bar" ;
190
203
let i = 0 ;
191
204
const kTagsPerLine = 3 ;
192
205
for ( const tag of Tags ) {
193
206
if ( tag === "all" )
194
207
continue ;
195
208
if ( ! ( i % kTagsPerLine ) ) {
196
- buttons = control . appendChild ( document . createElement ( "div" ) ) ;
209
+ buttons = tags . appendChild ( document . createElement ( "div" ) ) ;
197
210
buttons . className = "button-bar" ;
198
211
}
199
212
i ++ ;
200
- button = document . createElement ( "button" ) ;
213
+ const button = document . createElement ( "button" ) ;
201
214
button . className = "tag" ;
202
215
button . textContent = `#${ tag } ` ;
203
216
button . dataTag = tag ;
@@ -217,8 +230,7 @@ function createUIForSuites() {
217
230
} ;
218
231
buttons . appendChild ( button ) ;
219
232
}
220
-
221
- return control ;
233
+ return tags ;
222
234
}
223
235
224
236
function createUIForRun ( ) {
0 commit comments