mirror of
https://github.com/twbs/bootstrap.git
synced 2025-09-09 05:00:45 +02:00
Add bs
in data attributes
- Add `bs` in data APIs everywhere - Update unit tests
This commit is contained in:
@@ -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
|
||||
},
|
||||
|
Reference in New Issue
Block a user