luci-base: cbi.js: remove dead code in cbi_validate_field()
authorJo-Philipp Wich <jo@mein.io>
Mon, 5 Nov 2018 17:50:24 +0000 (18:50 +0100)
committerJo-Philipp Wich <jo@mein.io>
Wed, 14 Nov 2018 19:46:04 +0000 (20:46 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/htdocs/luci-static/resources/cbi.js

index 00eb53d7ba491d5a8d6df07293af83d4c70a175a..9c8341cc54a4a0ac62aa5f51225a3da005aec7fa 100644 (file)
@@ -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);
        }
 }