From 3410a98f938f819fae3be110ac25888fa1022b29 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 13 Mar 2015 05:43:57 -0400 Subject: [PATCH] refactor(config) onChange: str -> regexp --- lib/client/config.js | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/lib/client/config.js b/lib/client/config.js index d53d8252..f18899ff 100644 --- a/lib/client/config.js +++ b/lib/client/config.js @@ -174,14 +174,10 @@ var CloudCmd, Util, DOM, io; data = getValue(el); if (type === 'checkbox') - if (el.id === 'localStorage') + if (/^(diff|buffer|dirStorage)$/.test(el.id)) + onLSChange(el); + else if (el.id === 'localStorage') onLocalStorageChange(); - else if (el.id === 'diff') - onLSChange(el); - else if (el.id === 'buffer') - onLSChange(el); - else if (el.id === 'dirStorage') - onLSChange(el); else if (el.id === 'auth') onAuthChange(data);