Skip to content

Commit

Permalink
Workaround for broken Browser Back for anchors. Fixes lsegal#1071
Browse files Browse the repository at this point in the history
  • Loading branch information
thomthom committed Mar 1, 2019
1 parent e3e6990 commit e39014e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions templates/default/fulldoc/html/js/app.js
Expand Up @@ -275,6 +275,16 @@ function mainFocus() {
setTimeout(function() { $('#main').focus(); }, 10);
}

function navigationChange() {
// This works around the broken anchor navigation with the YARD template.
window.onpopstate = function() {
var hash = window.location.hash;
if (hash !== '' && $(hash)[0]) {
$(hash)[0].scrollIntoView();
}
};
}

$(document).ready(function() {
navResizer();
navExpander();
Expand All @@ -287,6 +297,7 @@ $(document).ready(function() {
constantSummaryToggle();
generateTOC();
mainFocus();
navigationChange();
});

})();

0 comments on commit e39014e

Please sign in to comment.