Commit 3595dbc3 authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Look for key in checked_list and add case for empty checked_list

parent 3ca2e68e
...@@ -59,6 +59,11 @@ ...@@ -59,6 +59,11 @@
subid, subid,
node; node;
// checked_list should be an empty array if it is undefined
if (!checked_list) {
checked_list = [];
}
if (tree.hasOwnProperty('sub')) { if (tree.hasOwnProperty('sub')) {
for (key in tree.sub) { for (key in tree.sub) {
if (tree.sub.hasOwnProperty(key)) { if (tree.sub.hasOwnProperty(key)) {
...@@ -70,7 +75,7 @@ ...@@ -70,7 +75,7 @@
node['data-path'] = tree.sub[key].path; node['data-path'] = tree.sub[key].path;
// If the path is in checked_list, put checked to True so that we // If the path is in checked_list, put checked to True so that we
// can update it in HTML directly // can update it in HTML directly
if (id in checked_list) { if (key in checked_list) {
node['data-checked'] = true; node['data-checked'] = true;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment