Skip to content
Snippets Groups Projects
Commit b22d7436 authored by Austin Anderson's avatar Austin Anderson
Browse files

More debugging

parent 4a18707f
No related branches found
No related tags found
No related merge requests found
......@@ -106,11 +106,19 @@ $(function () {
// Empty!
// If the hash matches a Category on the page, then scroll to it once the
// window gets focus (this handles e.g. if opened in the background)
} else if (document.getElementById(unescaped)) {
console.log("Scrolling to", unescaped)
} else if ($("span[id='" + unescaped + "']").length) {
let scrolled = false
console.log("ID detected")
$(window).focus(function() {
console.log("Running window focus handler")
if (!scrolled) {
console.log("Scrolling in the window focus handler")
document.getElementById(unescaped).scrollIntoView({
behavior: 'smooth'
});
scrolled = true
}
});
// If the hash is exactly 41 chars (hash sign # plus a 40-char sha hash),
// just show that modal.
} else if (window.location.hash.length == 41) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment