File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -106,13 +106,22 @@ function getCategoryNames(table, buildKey) {
106106 return categoryChoise ;
107107}
108108
109+ function generateDefaultList ( categoryTable ) {
110+ let list = [ ] ;
111+ for ( const item of categoryTable ) {
112+ list . push ( item . name ) ;
113+ }
114+ return list ;
115+ }
116+
109117function createCategorySelect ( table , map ) {
110118 let categorySelect = $ ( 'select.auxiliary_category_select' ) ;
119+ const allCat = generateDefaultList ( categoryTable ) ;
111120
112- const categoryNameObj = getConfig ( 'auxiliaryCategoryNameList' , '' ) ; // read user pre selected categories
121+ const categoryNameObj = getConfig ( 'auxiliaryCategoryNameList' , allCat ) ; // read user pre selected categories, if empty default to complete list
113122 let categoryNameList = categoryNameObj . auxiliaryCategoryNameList ;
114123 if ( categoryNameList . length == 0 ) {
115- categoryNameList = getCategoryNames ( table , 'all' ) ; // empty choise -> select names from 'all' category
124+ categoryNameList = getCategoryNames ( table , 'all' ) ; // empty choise -> select names from 'all' category
116125 setConfig ( { auxiliaryCategoryNameList : categoryNameList } ) ;
117126 }
118127
@@ -126,11 +135,6 @@ function createCategorySelect(table, map) {
126135 categorySelect . append ( `<option value="${ value . name } ">${ value . name } </option>` ) ;
127136 }
128137 }
129- /*
130- else {
131- categorySelect.append(`<option value="${value.name}" disabled="disabled">${value.name}</option>`);
132- }
133- */
134138 }
135139
136140 const modeWidth = 125 ;
You can’t perform that action at this time.
0 commit comments