From e35fb36ea59e271aa9726a73783446977ac0166e Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 5 Nov 2018 18:50:24 +0100 Subject: [PATCH] luci-base: cbi.js: remove dead code in cbi_validate_field() Signed-off-by: Jo-Philipp Wich --- .../luci-base/htdocs/luci-static/resources/cbi.js | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/modules/luci-base/htdocs/luci-static/resources/cbi.js b/modules/luci-base/htdocs/luci-static/resources/cbi.js index 00eb53d7b..9c8341cc5 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); } } -- 2.25.1