aboutsummaryrefslogtreecommitdiff
path: root/js/dist/collapse.js
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2021-07-29 09:14:40 +0300
committerGitHub <[email protected]>2021-07-29 09:14:40 +0300
commitef5336373fc2431b3d1d37cde85cd262210a1dc6 (patch)
treee325fb4c5532b464d05780c731d0f118f2a88d7f /js/dist/collapse.js
parent62edf07d7491684fe67a9c1e9439ed2bd10ca741 (diff)
parentc6c0bbb0b67fe89b55740a63fd10d4ad79044970 (diff)
downloadbootstrap-main-fod-simpler-table-structure.tar.xz
bootstrap-main-fod-simpler-table-structure.zip
Merge branch 'main' into main-fod-simpler-table-structuremain-fod-simpler-table-structure
Diffstat (limited to 'js/dist/collapse.js')
-rw-r--r--js/dist/collapse.js21
1 files changed, 15 insertions, 6 deletions
diff --git a/js/dist/collapse.js b/js/dist/collapse.js
index e2abc99c4..5a1beb7d3 100644
--- a/js/dist/collapse.js
+++ b/js/dist/collapse.js
@@ -1,5 +1,5 @@
/*!
- * Bootstrap collapse.js v5.0.1 (https://getbootstrap.com/)
+ * Bootstrap collapse.js v5.0.2 (https://getbootstrap.com/)
* Copyright 2011-2021 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@@ -115,9 +115,18 @@
return null;
};
+ const DOMContentLoadedCallbacks = [];
+
const onDOMContentLoaded = callback => {
if (document.readyState === 'loading') {
- document.addEventListener('DOMContentLoaded', callback);
+ // add listener on the first call when the document is in loading state
+ if (!DOMContentLoadedCallbacks.length) {
+ document.addEventListener('DOMContentLoaded', () => {
+ DOMContentLoadedCallbacks.forEach(callback => callback());
+ });
+ }
+
+ DOMContentLoadedCallbacks.push(callback);
} else {
callback();
}
@@ -144,7 +153,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.0.1): collapse.js
+ * Bootstrap (v5.0.2): collapse.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -260,7 +269,7 @@
if (actives) {
const tempActiveData = actives.find(elem => container !== elem);
- activesData = tempActiveData ? Data__default['default'].get(tempActiveData, DATA_KEY) : null;
+ activesData = tempActiveData ? Collapse.getInstance(tempActiveData) : null;
if (activesData && activesData._isTransitioning) {
return;
@@ -423,7 +432,7 @@
static collapseInterface(element, config) {
- let data = Data__default['default'].get(element, DATA_KEY);
+ let data = Collapse.getInstance(element);
const _config = { ...Default,
...Manipulator__default['default'].getDataAttributes(element),
...(typeof config === 'object' && config ? config : {})
@@ -470,7 +479,7 @@
const selector = getSelectorFromElement(this);
const selectorElements = SelectorEngine__default['default'].find(selector);
selectorElements.forEach(element => {
- const data = Data__default['default'].get(element, DATA_KEY);
+ const data = Collapse.getInstance(element);
let config;
if (data) {