]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Abide: Moving check for custom validators before check for whether input 5657/head
authorDan Coates <dan@vi.com.au>
Fri, 22 Aug 2014 02:29:52 +0000 (12:29 +1000)
committerDan Coates <dan@vi.com.au>
Fri, 22 Aug 2014 02:35:57 +0000 (12:35 +1000)
is a checkbox/radio input. This allows custom validators on checkbox and
radio inputs as well as other inputs.

This is in relation to #5656

js/foundation/foundation.abide.js

index cd6471c869e3b270db98db1867f8aae906ea41fb..13deb8533f6984556cf0ac1c59199dd89f0d6645 100755 (executable)
           parent = direct_parent.parent();
         }
 
+        if (validator) {
+          valid = this.settings.validators[validator].apply(this, [el, required, parent]);
+          validations.push(valid);
+        }
+
         if (is_radio && required) {
           validations.push(this.valid_radio(el, required));
         } else if (is_checkbox && required) {
           validations.push(this.valid_checkbox(el, required));
         } else {
           
-          if (validator) {
-            valid = this.settings.validators[validator].apply(this, [el, required, parent]);
-            validations.push(valid);
-          }
-
           if (el_patterns[i][1].test(value) && valid_length ||
             !required && el.value.length < 1 || $(el).attr('disabled')) {
             validations.push(true);