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
diff options
context:
space:
mode:
Diffstat (limited to 'js/dist/dom/manipulator.js')
-rw-r--r--js/dist/dom/manipulator.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/js/dist/dom/manipulator.js b/js/dist/dom/manipulator.js
index 3e3e69ded3..a22f0d875a 100644
--- a/js/dist/dom/manipulator.js
+++ b/js/dist/dom/manipulator.js
@@ -9,8 +9,6 @@
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, global.Manipulator = factory());
}(this, (function () { 'use strict';
- function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
-
/**
* --------------------------------------------------------------------------
* Bootstrap (v5.0.0-alpha3): dom/manipulator.js
@@ -45,25 +43,28 @@
var Manipulator = {
setDataAttribute: function setDataAttribute(element, key, value) {
- element.setAttribute("data-" + normalizeDataKey(key), value);
+ element.setAttribute("data-bs-" + normalizeDataKey(key), value);
},
removeDataAttribute: function removeDataAttribute(element, key) {
- element.removeAttribute("data-" + normalizeDataKey(key));
+ element.removeAttribute("data-bs-" + normalizeDataKey(key));
},
getDataAttributes: function getDataAttributes(element) {
if (!element) {
return {};
}
- var attributes = _extends({}, element.dataset);
-
- Object.keys(attributes).forEach(function (key) {
- attributes[key] = normalizeData(attributes[key]);
+ var attributes = {};
+ Object.keys(element.dataset).filter(function (key) {
+ return key.startsWith('bs');
+ }).forEach(function (key) {
+ var pureKey = key.replace(/^bs/, '');
+ pureKey = pureKey.charAt(0).toLowerCase() + pureKey.slice(1, pureKey.length);
+ attributes[pureKey] = normalizeData(element.dataset[key]);
});
return attributes;
},
getDataAttribute: function getDataAttribute(element, key) {
- return normalizeData(element.getAttribute("data-" + normalizeDataKey(key)));
+ return normalizeData(element.getAttribute("data-bs-" + normalizeDataKey(key)));
},
offset: function offset(element) {
var rect = element.getBoundingClientRect();