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/dom
diff options
context:
space:
mode:
authorRohit Sharma <rohit2sharma95@gmail.com>2020-07-22 22:33:11 +0300
committerXhmikosR <xhmikosr@gmail.com>2020-11-14 08:09:15 +0300
commit418f17ee2b849dafdc39623ba2378df9229164a7 (patch)
tree7446b75f6b2a8e8ad9f5f8ab8143b4d451c94a14 /js/src/dom
parentfe961c192d951bde610cdcd4817f4d8548d33141 (diff)
Add `bs` in data attributes
- Add `bs` in data APIs everywhere - Update unit tests
Diffstat (limited to 'js/src/dom')
-rw-r--r--js/src/dom/manipulator.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/js/src/dom/manipulator.js b/js/src/dom/manipulator.js
index bcbd340ace..04b9543c8a 100644
--- a/js/src/dom/manipulator.js
+++ b/js/src/dom/manipulator.js
@@ -47,9 +47,13 @@ const Manipulator = {
...element.dataset
}
- Object.keys(attributes).forEach(key => {
- attributes[key] = normalizeData(attributes[key])
- })
+ Object.keys(attributes)
+ .filter(key => key.startsWith('bs'))
+ .forEach(key => {
+ let pureKey = key.replace(/^bs/, '')
+ pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length)
+ attributes[pureKey] = normalizeData(attributes[key])
+ })
return attributes
},