1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-09-02 01:42:36 +02:00

Make the attribute methods bs specific (#32173)

Co-authored-by: XhmikosR <xhmikosr@gmail.com>
This commit is contained in:
Rohit Sharma
2020-11-20 14:43:13 +05:30
committed by GitHub
parent a96b118f04
commit 2630b05eb3
3 changed files with 34 additions and 30 deletions

View File

@@ -31,11 +31,11 @@ function normalizeDataKey(key) {
const Manipulator = {
setDataAttribute(element, key, value) {
element.setAttribute(`data-${normalizeDataKey(key)}`, value)
element.setAttribute(`data-bs-${normalizeDataKey(key)}`, value)
},
removeDataAttribute(element, key) {
element.removeAttribute(`data-${normalizeDataKey(key)}`)
element.removeAttribute(`data-bs-${normalizeDataKey(key)}`)
},
getDataAttributes(element) {
@@ -57,7 +57,7 @@ const Manipulator = {
},
getDataAttribute(element, key) {
return normalizeData(element.getAttribute(`data-${normalizeDataKey(key)}`))
return normalizeData(element.getAttribute(`data-bs-${normalizeDataKey(key)}`))
},
offset(element) {