]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Custom Pattern and Validator code fix 10298/head
authorWulf Sölter <wulf@wulf.co.nz>
Thu, 29 Jun 2017 22:43:00 +0000 (10:43 +1200)
committerGitHub <noreply@github.com>
Thu, 29 Jun 2017 22:43:00 +0000 (10:43 +1200)
JS example fixed - set defaults **before** initializing foundation. Won't work otherwise.

docs/pages/abide.md

index f419710ee1a40c04fe9e672d34370a8139766578..4888511e9a0a99cb6a593b8e9bedaf4eb36b8abe 100644 (file)
@@ -344,9 +344,14 @@ website: {
 * Add new patterns and validators before or after foundation is initialized
 
 ```javascript
-$(document).foundation();
+
+// Set paramaters
 Foundation.Abide.defaults.patterns['dashes_only'] = /^[0-9-]*$/;
 Foundation.Abide.defaults.validators['greater_than'] =
+
+// Init Foundation
+$(document).foundation();
+
 function($el,required,parent) {
   // parameter 1 is jQuery selector
   if (!required) return true;