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
path: root/js
diff options
context:
space:
mode:
authorXhmikosR <xhmikosr@gmail.com>2020-06-20 19:07:20 +0300
committerXhmikosR <xhmikosr@gmail.com>2020-07-12 15:52:25 +0300
commitb97fcd32899f3aff87b2885dedd99fd8634c0de9 (patch)
tree177ef0880e63e2791e284f7a185e9d38a4bfb74c /js
parentf15af45c6eb7d977923c339d686023e1ce4d011c (diff)
scrollspy.js: minor refactoring
Diffstat (limited to 'js')
-rw-r--r--js/src/scrollspy.js7
1 files changed, 1 insertions, 6 deletions
diff --git a/js/src/scrollspy.js b/js/src/scrollspy.js
index 9156223111..6f7dd04f27 100644
--- a/js/src/scrollspy.js
+++ b/js/src/scrollspy.js
@@ -113,18 +113,13 @@ class ScrollSpy {
this._offsets = []
this._targets = []
-
this._scrollHeight = this._getScrollHeight()
const targets = SelectorEngine.find(this._selector)
targets.map(element => {
- let target
const targetSelector = getSelectorFromElement(element)
-
- if (targetSelector) {
- target = SelectorEngine.findOne(targetSelector)
- }
+ const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null
if (target) {
const targetBCR = target.getBoundingClientRect()