aboutsummaryrefslogtreecommitdiff
path: root/js/dist/scrollspy.js
diff options
context:
space:
mode:
authorXhmikosR <[email protected]>2021-06-22 21:29:16 +0300
committerGitHub <[email protected]>2021-06-22 21:29:16 +0300
commit688bce4fa695cc360a0d084e34f029b0c192b223 (patch)
treedcda8a139b0225f23df2c3d3811afdefbc6d5af0 /js/dist/scrollspy.js
parent16d5041a76748580bae47ce168ba579daae9725b (diff)
downloadbootstrap-688bce4fa695cc360a0d084e34f029b0c192b223.tar.xz
bootstrap-688bce4fa695cc360a0d084e34f029b0c192b223.zip
Release v5.0.2 (#34276)v5.0.2
* Bump version to v5.0.2. * Dist
Diffstat (limited to 'js/dist/scrollspy.js')
-rw-r--r--js/dist/scrollspy.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/js/dist/scrollspy.js b/js/dist/scrollspy.js
index 87c2bb290..04f9b77e2 100644
--- a/js/dist/scrollspy.js
+++ b/js/dist/scrollspy.js
@@ -1,5 +1,5 @@
/*!
- * Bootstrap scrollspy.js v5.0.1 (https://getbootstrap.com/)
+ * Bootstrap scrollspy.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)
*/
@@ -18,7 +18,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.0.1): util/index.js
+ * Bootstrap (v5.0.2): util/index.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -117,9 +117,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();
}
@@ -146,7 +155,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.0.1): scrollspy.js
+ * Bootstrap (v5.0.2): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -361,7 +370,7 @@
static jQueryInterface(config) {
return this.each(function () {
- const data = ScrollSpy.getInstance(this) || new ScrollSpy(this, typeof config === 'object' ? config : {});
+ const data = ScrollSpy.getOrCreateInstance(this, config);
if (typeof config !== 'string') {
return;