Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/util')
-rw-r--r--js/src/util/config.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/js/src/util/config.js b/js/src/util/config.js
index 19d02955dd..f6c194276b 100644
--- a/js/src/util/config.js
+++ b/js/src/util/config.js
@@ -38,8 +38,11 @@ class Config {
}
_mergeConfigObj(config, element) {
+ const jsonConfig = isElement(element) ? Manipulator.getDataAttribute(element, 'config') : {} // try to parse
+
return {
...this.constructor.Default,
+ ...(typeof jsonConfig === 'object' ? jsonConfig : {}),
...(isElement(element) ? Manipulator.getDataAttributes(element) : {}),
...(typeof config === 'object' ? config : {})
}