Skip to content

Commit

Permalink
Fix scrollIntoView undefined bug when there is no hash, fixes #114
Browse files Browse the repository at this point in the history
Thanks to @kevin-buttercoin for this fix!
  • Loading branch information
lord committed Dec 4, 2014
1 parent 902ddd7 commit be28b78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/javascripts/app/lang.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ under the License.
global.toc.calculateHeights();

// scroll to the new location of the position
$(window.location.hash).get(0).scrollIntoView(true);
if ($(window.location.hash).get(0)) {
$(window.location.hash).get(0).scrollIntoView(true);
}
}

// if a button is clicked, add the state to the history
Expand Down

0 comments on commit be28b78

Please sign in to comment.