mirror of
https://github.com/twbs/bootstrap.git
synced 2024-12-01 13:24:25 +01:00
scrollspy.js: minor refactoring
This commit is contained in:
parent
f15af45c6e
commit
b97fcd3289
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user