Skip to content

Commit

Permalink
fixed support for unknown anchors in documentation browser
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 16, 2014
1 parent 99adfa2 commit fef93ad
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Mojolicious/templates/mojobar.html.ep
Expand Up @@ -71,8 +71,10 @@
var mojobar = $('#mojobar');
var mojobarHeight = mojobar.outerHeight();
function fixOffset() {
var tweak = $(window.location.hash).offset().top - mojobarHeight;
$('html, body').animate({scrollTop: tweak}, 1);
var offset = $(window.location.hash).offset();
if (offset) {
$('html, body').animate({scrollTop: offset.top - mojobarHeight}, 1);
}
}
$(window).load(function () {
if (window.location.hash) {
Expand Down

0 comments on commit fef93ad

Please sign in to comment.