mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 18:55:26 +00:00
refactor(config) onChange: event -> el
This commit is contained in:
parent
806ec25d8e
commit
3976ffed2d
1 changed files with 6 additions and 7 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue