@@ -39,6 +39,10 @@ export default class AssetCategory {
3939 get paletteDefinitions ( ) { return this . optionController . paletteDefinitions }
4040 get categoryDefinitions ( ) { return this . optionController . categoryDefinitions }
4141
42+ categoryId ( ) {
43+ return `${ this . name } -category`
44+ }
45+
4246 /**
4347 * Returns the tags for the selected option
4448 *
@@ -88,9 +92,7 @@ export default class AssetCategory {
8892
8993 if ( redrawSpritesheet ) {
9094 this . optionController . fixExcludedOptions ( this )
91- this . optionController . update ( )
9295 await this . spritesheetController . update ( )
93- this . attributionController . update ( )
9496 this . optionController . updatePreviewFrameSize ( )
9597 }
9698 }
@@ -156,57 +158,6 @@ export default class AssetCategory {
156158 return true
157159 }
158160
159- /**
160- * Returns the HTML to display this category
161- *
162- * @returns {HTMLElement }
163- */
164- html ( ) {
165- const name = this . name
166-
167- const container = document . createElement ( 'fieldset' )
168- container . id = `${ name } -options`
169-
170- const label = document . createElement ( 'legend' )
171- label . textContent = name
172- container . appendChild ( label )
173-
174- container . appendChild ( this . colorsHTML ( ) )
175-
176- const optionsContainer = document . createElement ( 'div' )
177- optionsContainer . className = 'category-item-options'
178- container . appendChild ( optionsContainer )
179-
180- const options = this . availableOptions ( )
181- options . forEach ( option => {
182- optionsContainer . appendChild ( option . html ( ) )
183- } )
184-
185- return container
186- }
187-
188- /**
189- * Returns the HTML for this category's color options
190- *
191- * @returns {HTMLElement }
192- */
193- colorsHTML ( ) {
194- const colorsContatinerID = `${ this . name } -colors`
195- const previousColors = document . getElementById ( colorsContatinerID )
196- if ( previousColors ) previousColors . remove ( )
197-
198- const container = document . createElement ( 'div' )
199- container . id = colorsContatinerID
200- container . className = 'item-color-options'
201-
202- this . selectedPaletteNames ( ) . forEach ( paletteName => {
203- const palette = this . palettes [ paletteName ]
204- container . appendChild ( palette . html ( ) )
205- } )
206-
207- return container
208- }
209-
210161 /**
211162 * Generates all palettes for the options in the category and returns
212163 * key-value list of names and the corresponding palette
0 commit comments