mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-08 17:22:31 +03:00
scrollspy.js: minor refactoring
This commit is contained in:
+1
-6
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user