From 3976ffed2dae5663806795af44761dc1bf2d0203 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 7 Nov 2014 04:43:48 -0500 Subject: [PATCH] refactor(config) onChange: event -> el --- lib/client/config.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/client/config.js b/lib/client/config.js index fa3b8979..847d8169 100644 --- a/lib/client/config.js +++ b/lib/client/config.js @@ -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); } });