Update basic-handbook.page.js (#4859)

This commit is contained in:
Eric 2022-03-29 11:30:54 -05:00 committed by GitHub
parent a402ccab25
commit edd1f7d06f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -36,6 +36,16 @@ parasails.registerPage('basic-handbook', {
},
});
// Handle hashes in urls when coming from an external page.
if(window.location.hash){
let possibleHashToScrollTo = _.trimLeft(window.location.hash, '#');
let hashToScrollTo = document.getElementById(possibleHashToScrollTo);
// If the hash matches a header's ID, we'll scroll to that section.
if(hashToScrollTo){
hashToScrollTo.scrollIntoView();
}
}
this.subtopics = (() => {
let subtopics;
if(!this.isHandbookLandingPage){