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

Thanks to @kevin-buttercoin for this fix!
This commit is contained in:
Robert Lord 2014-12-04 15:41:08 -08:00
parent 902ddd7fdc
commit be28b785a1

View file

@ -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