]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
fixed programmatic use of interchange. see #9332 9589/head
authorJörn Röder <joernroeder@users.noreply.github.com>
Tue, 3 Jan 2017 14:54:26 +0000 (15:54 +0100)
committerGitHub <noreply@github.com>
Tue, 3 Jan 2017 14:54:26 +0000 (15:54 +0100)
js/foundation.interchange.js

index b43fe93ec360983cdc08e8f4bf07c1c40bfb492c..06d4ff70240d957b27b89bc9d4a078a45a64fd17 100644 (file)
@@ -103,8 +103,10 @@ class Interchange {
       rules = this.options.rules;
     }
     else {
-      rules = this.$element.data('interchange').match(/\[.*?\]/g);
+      rules = this.$element.data('interchange');
     }
+    
+    rules =  typeof rules === 'string' ? rules.match(/\[.*?\]/g) : rules;
 
     for (var i in rules) {
       if(rules.hasOwnProperty(i)) {