From 6f4af8d636678776b165666f94c0ab592a49b2f3 Mon Sep 17 00:00:00 2001 From: Shawn Jonnet Date: Mon, 9 Dec 2013 17:45:35 -0500 Subject: [PATCH] Allow declarative pattern overrides Noticed this issue when trying to override the current password pattern in a single use. --- js/foundation/foundation.abide.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/js/foundation/foundation.abide.js b/js/foundation/foundation.abide.js index 66e10f766..1f9b960f1 100644 --- a/js/foundation/foundation.abide.js +++ b/js/foundation/foundation.abide.js @@ -115,10 +115,6 @@ var type = el.getAttribute('type'), required = typeof el.getAttribute('required') === 'string'; - if (this.settings.patterns.hasOwnProperty(type)) { - return [el, this.settings.patterns[type], required]; - } - var pattern = el.getAttribute('pattern') || ''; if (this.settings.patterns.hasOwnProperty(pattern) && pattern.length > 0) { @@ -126,6 +122,10 @@ } else if (pattern.length > 0) { return [el, new RegExp(pattern), required]; } + + if (this.settings.patterns.hasOwnProperty(type)) { + return [el, this.settings.patterns[type], required]; + } pattern = /.*/; @@ -213,4 +213,4 @@ return valid; } }; -}(jQuery, this, this.document)); \ No newline at end of file +}(jQuery, this, this.document)); -- 2.47.2