mirror of
https://github.com/twbs/bootstrap.git
synced 2025-08-16 02:24:19 +02:00
21
js/dist/collapse.js
vendored
21
js/dist/collapse.js
vendored
@@ -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) {
|
||||
|
Reference in New Issue
Block a user