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._offsets = []
|
||||||
this._targets = []
|
this._targets = []
|
||||||
|
|
||||||
this._scrollHeight = this._getScrollHeight()
|
this._scrollHeight = this._getScrollHeight()
|
||||||
|
|
||||||
const targets = SelectorEngine.find(this._selector)
|
const targets = SelectorEngine.find(this._selector)
|
||||||
|
|
||||||
targets.map(element => {
|
targets.map(element => {
|
||||||
let target
|
|
||||||
const targetSelector = getSelectorFromElement(element)
|
const targetSelector = getSelectorFromElement(element)
|
||||||
|
const target = targetSelector ? SelectorEngine.findOne(targetSelector) : null
|
||||||
if (targetSelector) {
|
|
||||||
target = SelectorEngine.findOne(targetSelector)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (target) {
|
if (target) {
|
||||||
const targetBCR = target.getBoundingClientRect()
|
const targetBCR = target.getBoundingClientRect()
|
||||||
|
Loading…
Reference in New Issue
Block a user