Commit 0df2f3ed authored by Boris Kocherov's avatar Boris Kocherov

remove function loadEventList(gadget)

parent 0028a25c
...@@ -461,44 +461,6 @@ ...@@ -461,44 +461,6 @@
}); });
} }
function loadEventList(gadget) {
var g = gadget,
field_list = g.props.inputs,
button_list = g.props.add_buttons,
label_list = g.element.querySelectorAll('label.slapos-parameter-dict-key'),
i,
promise_list = [];
for (i = 0; i < field_list.length; i = i + 1) {
promise_list.push(loopEventListener(
field_list[i],
'change',
false,
gadget.processValidation.bind(g, g.options.schema_url, undefined)
));
}
for (i = 0; i < button_list.length; i = i + 1) {
promise_list.push(loopEventListener(
button_list[i].element,
'click',
false,
addSubForm.bind(g, g, button_list[i])
));
}
// for (i = 0; i < label_list.length; i = i + 1) {
// promise_list.push(loopEventListener(
// label_list[i],
// 'click',
// false,
// collapseParameter.bind(g, label_list[i])
// ));
// }
return RSVP.all(promise_list);
}
rJS(window) rJS(window)
.ready(function () { .ready(function () {
var g = this; var g = this;
...@@ -641,7 +603,41 @@ ...@@ -641,7 +603,41 @@
}) })
.declareJob('listenEvents', function () { .declareJob('listenEvents', function () {
return loadEventList(this); var g = this,
field_list = g.props.inputs,
button_list = g.props.add_buttons,
label_list = g.element.querySelectorAll('label.slapos-parameter-dict-key'),
i,
promise_list = [];
for (i = 0; i < field_list.length; i = i + 1) {
promise_list.push(loopEventListener(
field_list[i],
'change',
false,
g.processValidation.bind(g, g.options.schema_url, undefined)
));
}
for (i = 0; i < button_list.length; i = i + 1) {
promise_list.push(loopEventListener(
button_list[i].element,
'click',
false,
addSubForm.bind(g, g, button_list[i])
));
}
// for (i = 0; i < label_list.length; i = i + 1) {
// promise_list.push(loopEventListener(
// label_list[i],
// 'click',
// false,
// collapseParameter.bind(g, label_list[i])
// ));
// }
return RSVP.all(promise_list);
}) })
.declareMethod('getContent', function () { .declareMethod('getContent', function () {
......
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