From e35fb36ea59e271aa9726a73783446977ac0166e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 5 Nov 2018 18:50:24 +0100 Subject: luci-base: cbi.js: remove dead code in cbi_validate_field() Signed-off-by: Jo-Philipp Wich --- modules/luci-base/htdocs/luci-static/resources/cbi.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'modules/luci-base/htdocs/luci-static/resources/cbi.js') diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 00eb53d7ba..9c8341cc54 100644 --- a/modules/luci-base/htdocs/luci-static/resources/cbi.js +++ b/modules/luci-base/htdocs/luci-static/resources/cbi.js @@ -1117,10 +1117,7 @@ function cbi_validate_field(cbid, optional, type) try { var cbiValidator = new CBIValidator(field, type, optional); - - validatorFn = function() { - return cbiValidator.validate(); - }; + validatorFn = cbiValidator.validate.bind(cbiValidator); } catch(e) { validatorFn = null; @@ -1143,15 +1140,7 @@ function cbi_validate_field(cbid, optional, type) field.addEventListener("click", validatorFn); } - field.setAttribute("cbi_validate", validatorFn); - field.setAttribute("cbi_datatype", type); - field.setAttribute("cbi_optional", (!!optional).toString()); - validatorFn(); - - var fcbox = document.getElementById('cbi.combobox.' + field.id); - if (fcbox) - cbi_validate_field(fcbox, optional, type); } } -- cgit v1.2.3