File tree 1 file changed +11
-7
lines changed
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) {
106
106
return categoryChoise ;
107
107
}
108
108
109
+ function generateDefaultList ( categoryTable ) {
110
+ let list = [ ] ;
111
+ for ( const item of categoryTable ) {
112
+ list . push ( item . name ) ;
113
+ }
114
+ return list ;
115
+ }
116
+
109
117
function createCategorySelect ( table , map ) {
110
118
let categorySelect = $ ( 'select.auxiliary_category_select' ) ;
119
+ const allCat = generateDefaultList ( categoryTable ) ;
111
120
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
113
122
let categoryNameList = categoryNameObj . auxiliaryCategoryNameList ;
114
123
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
116
125
setConfig ( { auxiliaryCategoryNameList : categoryNameList } ) ;
117
126
}
118
127
@@ -126,11 +135,6 @@ function createCategorySelect(table, map) {
126
135
categorySelect . append ( `<option value="${ value . name } ">${ value . name } </option>` ) ;
127
136
}
128
137
}
129
- /*
130
- else {
131
- categorySelect.append(`<option value="${value.name}" disabled="disabled">${value.name}</option>`);
132
- }
133
- */
134
138
}
135
139
136
140
const modeWidth = 125 ;
You can’t perform that action at this time.
0 commit comments