json: Make URL #fragment jump to the right spot after loading (#233)

This commit is contained in:
Francis Lavoie 2022-05-15 15:02:31 -04:00 committed by GitHub
parent e03cbec7c4
commit 64d67e510e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,12 @@ $.get("/api/docs/config"+configPath, function(json) {
$('<span> &rsaquo; <a href="'+jsonDocsPathPrefix+bcPath.substr(1)+'/" class="breadcrumb has-popup" data-sibling-path="'+bcSiblingPath+'">'+pathComponents[i]+'</a></span>').appendTo($bc);
}
// re-trigger the URL fragment if any, to scroll to the archor
var fragment = window.location.hash;
if (fragment) {
window.location.hash = '';
window.location.hash = fragment;
}
});
});