Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/twbs/bootstrap.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRohit Sharma <rohit2sharma95@gmail.com>2021-02-22 10:01:04 +0300
committerGitHub <noreply@github.com>2021-02-22 10:01:04 +0300
commitdc5e3328c12058de7fb6404edbe5dcee61f3400f (patch)
treeef141013ee4df32fbd3e581d9647e71f713bb043 /js/src/scrollspy.js
parentd983744d12be0937bb1aaef06057385d9b553e0c (diff)
Allow constructors to accept a CSS selector (#32245)
Co-authored-by: XhmikosR <xhmikosr@gmail.com> Co-authored-by: Mark Otto <otto@github.com>
Diffstat (limited to 'js/src/scrollspy.js')
-rw-r--r--js/src/scrollspy.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js
index 43a91e5e93..0c51eab0fe 100644
--- a/js/src/scrollspy.js
+++ b/js/src/scrollspy.js
@@ -68,7 +68,7 @@ const METHOD_POSITION = 'position'
class ScrollSpy extends BaseComponent {
constructor(element, config) {
super(element)
- this._scrollElement = element.tagName === 'BODY' ? window : element
+ this._scrollElement = this._element.tagName === 'BODY' ? window : this._element
this._config = this._getConfig(config)
this._selector = `${this._config.target} ${SELECTOR_NAV_LINKS}, ${this._config.target} ${SELECTOR_LIST_ITEMS}, ${this._config.target} .${CLASS_NAME_DROPDOWN_ITEM}`
this._offsets = []