aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/twbs/bootstrap/js/src/scrollspy.js
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2022-10-11 18:41:34 +0000
committerMario <mario@mariovavti.com>2022-10-11 18:41:34 +0000
commit10ba98c4f5ec4efe6272516de47f0ce128ef2902 (patch)
treefbbde69114acba764cf6b735433c53e099fd19c5 /vendor/twbs/bootstrap/js/src/scrollspy.js
parent108a3efe0b6d37a7ed394a84c69b924ca727f17a (diff)
downloadvolse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.tar.gz
volse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.tar.bz2
volse-hubzilla-10ba98c4f5ec4efe6272516de47f0ce128ef2902.zip
Revert "update composer libs"
This reverts commit 108a3efe0b6d37a7ed394a84c69b924ca727f17a.
Diffstat (limited to 'vendor/twbs/bootstrap/js/src/scrollspy.js')
-rw-r--r--vendor/twbs/bootstrap/js/src/scrollspy.js24
1 files changed, 10 insertions, 14 deletions
diff --git a/vendor/twbs/bootstrap/js/src/scrollspy.js b/vendor/twbs/bootstrap/js/src/scrollspy.js
index a73bba840..102a2e101 100644
--- a/vendor/twbs/bootstrap/js/src/scrollspy.js
+++ b/vendor/twbs/bootstrap/js/src/scrollspy.js
@@ -1,6 +1,6 @@
/**
* --------------------------------------------------------------------------
- * Bootstrap (v5.2.2): scrollspy.js
+ * Bootstrap (v5.2.0): scrollspy.js
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
* --------------------------------------------------------------------------
*/
@@ -40,16 +40,14 @@ const Default = {
offset: null, // 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'
}
/**
@@ -112,13 +110,6 @@ class ScrollSpy extends BaseComponent {
// TODO: on v6 target should be given explicitly & remove the {target: 'ss-target'} case
config.target = 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))
- }
-
return config
}
@@ -150,8 +141,8 @@ class ScrollSpy extends BaseComponent {
_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)
@@ -196,6 +187,11 @@ class ScrollSpy extends BaseComponent {
}
}
+ // 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() {
this._targetLinks = new Map()
this._observableSections = new Map()