Commit be28b785 authored by Robert Lord's avatar Robert Lord

Fix scrollIntoView undefined bug when there is no hash, fixes #114

Thanks to @kevin-buttercoin for this fix!
parent 902ddd7f
...@@ -33,8 +33,10 @@ under the License. ...@@ -33,8 +33,10 @@ under the License.
global.toc.calculateHeights(); global.toc.calculateHeights();
// scroll to the new location of the position // scroll to the new location of the position
if ($(window.location.hash).get(0)) {
$(window.location.hash).get(0).scrollIntoView(true); $(window.location.hash).get(0).scrollIntoView(true);
} }
}
// if a button is clicked, add the state to the history // if a button is clicked, add the state to the history
function pushURL(language) { function pushURL(language) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment