]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
apply custom config to lib settings 4519/head
authorJack Yao <yaohj@hotmail.com>
Sat, 22 Feb 2014 06:49:47 +0000 (14:49 +0800)
committerJack Yao <yaohj@hotmail.com>
Sat, 22 Feb 2014 06:49:47 +0000 (14:49 +0800)
js/foundation/foundation.js

index 1bd233aa92a172c06009dca705b2b6099656e4d8..7d70695b1f300b80e0bc42cea0738b3cf30cedc4 100644 (file)
         this.patch(this.libs[lib]);
 
         if (args && args.hasOwnProperty(lib)) {
+            if (typeof this.libs[lib].settings !== 'undefined') {
+                $.extend(true, this.libs[lib].settings, args[lib]);
+            }
+            else if (typeof this.libs[lib].defaults !== 'undefined') {
+                $.extend(true, this.libs[lib].defaults, args[lib]);
+            }
           return this.libs[lib].init.apply(this.libs[lib], [this.scope, args[lib]]);
         }