This repository was archived by the owner on Mar 29, 2021. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -192,6 +192,17 @@ idrinth.workers = {
192192 ]
193193 } ;
194194 } ;
195+ let makeTableRow = function ( data , tag ) {
196+ tag = typeof tag === 'string' ?tag :'td' ;
197+ let row = {
198+ type : "tr" ,
199+ children : [ ]
200+ } ;
201+ for ( let pos = 0 ; pos < data . length ; pos ++ ) {
202+ row . children . push ( { type : tag , content : data [ pos ] } ) ;
203+ }
204+ return row ;
205+ } ;
195206 for ( var count = list . length - 1 ; count >= 0 ; count -- ) {
196207 let boss = idrinth . tier . list [ list [ count ] ] ;
197208 let sub = idrinth . ui . buildElement ( {
@@ -244,31 +255,13 @@ idrinth.workers = {
244255 {
245256 type : "thead" ,
246257 children : [
247- {
248- type : "tr" ,
249- children : [
250- {
251- type : "th" ,
252- content : "#"
253- } ,
254- {
255- type : "th" ,
256- content : idrinth . text . get ( "tier.diff.normal" )
257- } ,
258- {
259- type : "th" ,
260- content : idrinth . text . get ( "tier.diff.hard" )
261- } ,
262- {
263- type : "th" ,
264- content : idrinth . text . get ( "tier.diff.legend" )
265- } ,
266- {
267- type : "th" ,
268- content : idrinth . text . get ( "tier.diff.night" )
269- }
270- ]
271- }
258+ makeTableRow ( [
259+ '#' ,
260+ idrinth . text . get ( "tier.diff.normal" ) ,
261+ idrinth . text . get ( "tier.diff.hard" ) ,
262+ idrinth . text . get ( "tier.diff.legend" ) ,
263+ idrinth . text . get ( "tier.diff.night" )
264+ ] , 'th' )
272265 ]
273266 } ,
274267 {
You can’t perform that action at this time.
0 commit comments