Commit 057c25da authored by Ayush Tiwari's avatar Ayush Tiwari

bt5_config: Do not hardcode keys in getContent, instead use key from the options

parent a1e95954
...@@ -88,11 +88,13 @@ ...@@ -88,11 +88,13 @@
.declareMethod('render', function (options) { .declareMethod('render', function (options) {
var parameter_dict = JSON.parse(options.value), var parameter_dict = JSON.parse(options.value),
item_path_list = parameter_dict.item_path_list, item_path_list = parameter_dict.item_path_list,
node_tree = convertPathListToTree(item_path_list), html_tree = buildTreeHTML('tree', convertPathListToTree(item_path_list)),
html_tree = buildTreeHTML('tree', node_tree); state_dict = {
this.action_url = parameter_dict.action_url; key: options.key
};
this.element.innerHTML = html_tree; this.element.innerHTML = html_tree;
console.log(html_tree); return this.changeState(state_dict);
}) })
.onEvent('change', function (evt) { .onEvent('change', function (evt) {
...@@ -151,7 +153,8 @@ ...@@ -151,7 +153,8 @@
.declareMethod('getContent', function () { .declareMethod('getContent', function () {
var i, var i,
path_list = []; path_list = [],
result = {};
// Get all the checked checkbox from both child_path and parent_path // Get all the checked checkbox from both child_path and parent_path
var checkedInputList = this.element.querySelectorAll( var checkedInputList = this.element.querySelectorAll(
...@@ -166,10 +169,9 @@ ...@@ -166,10 +169,9 @@
path_list.push(nextLabelElement.dataset.path); path_list.push(nextLabelElement.dataset.path);
} }
} }
var form_data = {'check_needed': 'True',
'item_path_list': path_list} ;
return form_data result[this.state.key] = path_list;
return result;
}); });
}(rJS, jIO, Handlebars, RSVP, window)); }(rJS, jIO, Handlebars, RSVP, window));
\ No newline at end of file
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