diff options
Diffstat (limited to 'vendor/twbs/bootstrap/js/dist/collapse.js')
-rw-r--r-- | vendor/twbs/bootstrap/js/dist/collapse.js | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/vendor/twbs/bootstrap/js/dist/collapse.js b/vendor/twbs/bootstrap/js/dist/collapse.js index e2abc99c4..5a1beb7d3 100644 --- a/vendor/twbs/bootstrap/js/dist/collapse.js +++ b/vendor/twbs/bootstrap/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) { |