diff --git a/templates/default/fulldoc/html/js/app.js b/templates/default/fulldoc/html/js/app.js
index fecf69db3..368f44a94 100644
--- a/templates/default/fulldoc/html/js/app.js
+++ b/templates/default/fulldoc/html/js/app.js
@@ -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();
@@ -287,6 +297,7 @@ $(document).ready(function() {
constantSummaryToggle();
generateTOC();
mainFocus();
+ navigationChange();
});
})();