From a4b5dae3ad7837bc74d69c529fc369a0da7dd67a Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Tue, 13 Jun 2023 17:36:14 +0200 Subject: [PATCH] blind inline oop --- main/actaddmanual/index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/main/actaddmanual/index.js b/main/actaddmanual/index.js index 1903fb7..6a652f5 100644 --- a/main/actaddmanual/index.js +++ b/main/actaddmanual/index.js @@ -45,10 +45,9 @@ function populateManual(lang) { entries.append(t); } - let anchor = undefined || location.hash; - // this is probably a terrible hack - if (anchor.startsWith("#")) { - let element = $(anchor); + // force-scroll to proper anchor + if (location.hash.startsWith("#")) { + let element = $(location.hash); if (element.length) { $('html, body').animate({ scrollTop: element.offset().top