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

Focus handler AND delay

parent 326db3e9
Branches 2014ss
No related tags found
No related merge requests found
...@@ -106,10 +106,15 @@ $(function () { ...@@ -106,10 +106,15 @@ $(function () {
// Empty! // Empty!
// If the hash matches a Category on the page, then scroll to it // If the hash matches a Category on the page, then scroll to it
} else if (document.getElementById(unescaped)) { } else if (document.getElementById(unescaped)) {
console.log("Trying to scroll!") let scrolled = false
$(window).focus(function() {
if (!scrolled) {
setTimeout(function () { setTimeout(function () {
document.getElementById(unescaped).scrollIntoView(); document.getElementById(unescaped).scrollIntoView();
}, 1000); }, 100);
scrolled = true
}
})
// If the hash is exactly 41 chars (hash sign # plus a 40-char sha hash), // If the hash is exactly 41 chars (hash sign # plus a 40-char sha hash),
// just show that modal. // just show that modal.
} else if (window.location.hash.length == 41) { } 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