aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/js/dist/scrollspy.js
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/twbs/bootstrap/js/dist/scrollspy.js')
-rw-r--r--vendor/twbs/bootstrap/js/dist/scrollspy.js28
1 files changed, 12 insertions, 16 deletions
diff --git a/vendor/twbs/bootstrap/js/dist/scrollspy.js b/vendor/twbs/bootstrap/js/dist/scrollspy.js
index 5dc511075..1cb5ee113 100644
--- a/vendor/twbs/bootstrap/js/dist/scrollspy.js
+++ b/vendor/twbs/bootstrap/js/dist/scrollspy.js
@@ -1,5 +1,5 @@
/*!
- * Bootstrap scrollspy.js v5.2.2 (https://getbootstrap.com/)
+ * Bootstrap scrollspy.js v5.2.0 (https://getbootstrap.com/)
* Copyright 2011-2022 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/
@@ -17,7 +17,7 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.2.2): scrollspy.js
+ * Bootstrap (v5.2.0): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -48,16 +48,14 @@
// TODO: v6 @deprecated, keep it for backwards compatibility reasons
rootMargin: '0px 0px -25%',
smoothScroll: false,
- target: null,
- threshold: [0.1, 0.5, 1]
+ target: null
};
const DefaultType = {
offset: '(number|null)',
// TODO v6 @deprecated, keep it for backwards compatibility reasons
rootMargin: 'string',
smoothScroll: 'boolean',
- target: 'element',
- threshold: 'array'
+ target: 'element'
};
/**
* Class definition
@@ -118,14 +116,7 @@
_configAfterMerge(config) {
// TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case
- config.target = index.getElement(config.target) || document.body; // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only
-
- config.rootMargin = config.offset ? `${config.offset}px 0px -30%` : config.rootMargin;
-
- if (typeof config.threshold === 'string') {
- config.threshold = config.threshold.split(',').map(value => Number.parseFloat(value));
- }
-
+ config.target = index.getElement(config.target) || document.body;
return config;
}
@@ -161,8 +152,8 @@
_getNewObserver() {
const options = {
root: this._rootElement,
- threshold: this._config.threshold,
- rootMargin: this._config.rootMargin
+ threshold: [0.1, 0.5, 1],
+ rootMargin: this._getRootMargin()
};
return new IntersectionObserver(entries => this._observerCallback(entries), options);
} // The logic of selection
@@ -207,6 +198,11 @@
activate(entry);
}
}
+ } // TODO: v6 Only for backwards compatibility reasons. Use rootMargin only
+
+
+ _getRootMargin() {
+ return this._config.offset ? `${this._config.offset}px 0px -30%` : this._config.rootMargin;
}
_initializeTargetsAndObservables() {