Skip to content

Commit f1f4001

Browse files
committed
fix TOC links
1 parent f0236af commit f1f4001

File tree

1 file changed

+2
-1
lines changed
  • scaladoc/resources/dotty_res/scripts

1 file changed

+2
-1
lines changed

scaladoc/resources/dotty_res/scripts/ux.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function attachAllListeners() {
5353
if (href === "") { return }
5454
const url = new URL(href)
5555
el.addEventListener('click', e => {
56-
if (url.href.replace("#", "") === window.location.href.replace("#", "")) { return }
56+
if (url.href.replace(/#.*/, "") === window.location.href.replace(/#.*/, "")) { return }
5757
if (url.origin !== window.location.origin) { return }
5858
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) { return }
5959
e.preventDefault()
@@ -188,6 +188,7 @@ document.getElementById("mobile-menu-close").addEventListener('click', _e => {
188188
})
189189

190190
window.addEventListener('popstate', e => {
191+
if (e.state === null) { return }
191192
const { leftColumn, mainDiv, title } = e.state
192193
document.title = title
193194
const { children } = document.body.firstChild

0 commit comments

Comments
 (0)