Skip to content

Commit f6ee349

Browse files
committed
Default list are all cat
1 parent dad8bbf commit f6ee349

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/js/tabs/auxiliary.js

+11-7
Original file line numberDiff line numberDiff 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+
109117
function 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;

0 commit comments

Comments
 (0)