mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-05-15 11:59:39 +03:00
second try
This commit is contained in:
+2
-1
@@ -127,7 +127,6 @@ class ScrollSpy extends BaseComponent {
|
||||
event.preventDefault()
|
||||
const root = this._rootElement || window
|
||||
const height = observableSection.offsetTop - this._element.offsetTop
|
||||
window.history.pushState(null, null, event.target.hash)
|
||||
if (root.scrollTo) {
|
||||
root.scrollTo({ top: height, behavior: 'smooth' })
|
||||
return
|
||||
@@ -222,6 +221,8 @@ class ScrollSpy extends BaseComponent {
|
||||
|
||||
this._clearActiveClass(this._config.target)
|
||||
this._activeTarget = target
|
||||
|
||||
window.history.pushState(null, null, target.hash)
|
||||
target.classList.add(CLASS_NAME_ACTIVE)
|
||||
this._activateParents(target)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user