refactor(config) onChange: event -> el

This commit is contained in:
coderaiser 2014-11-07 04:43:48 -05:00
parent 806ec25d8e
commit 3976ffed2d

View file

@ -129,8 +129,10 @@ var CloudCmd, Util, DOM, io;
}
Util.forEach(inputs, function(input) {
Events.add('change', input, onChange)
.addKey(input, onKey);
Events.addKey(input, onKey)
.add('change', input, function(event) {
onChange(event.target);
});
});
CloudCmd.View.show(div, {
@ -163,10 +165,9 @@ var CloudCmd, Util, DOM, io;
return ret;
}
function onChange(event) {
function onChange(el) {
var data,
obj = {},
el = event.target,
name = el.id,
type = el.type;
@ -271,9 +272,7 @@ var CloudCmd, Util, DOM, io;
if (element.checked) {
element.checked = false;
onChange({
target: element
});
onChange(element);
}
});