Skip to content

Commit

Permalink
fix issue #104: Issue comment anchor does not work as expected in
Browse files Browse the repository at this point in the history
Firefox
  • Loading branch information
robinshine committed Apr 19, 2020
1 parent a33cf68 commit 1693966
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -731,8 +731,11 @@ onedev.server = {

if (location.hash && !onedev.server.viewState.getFromHistory()) {
// Scroll anchors into view (for instance the markdown headline)
var element = document.getElementsByName(decodeURIComponent(location.hash.slice(1)))[0];
if (element)
var nameOrId = decodeURIComponent(location.hash.slice(1));
var element = document.getElementById(nameOrId);
if (!element)
element = document.getElementsByName(nameOrId)[0];
if (element)
element.scrollIntoView();
}
}
Expand Down

0 comments on commit 1693966

Please sign in to comment.