Fix #75, don't set page hash to undefined

This commit is contained in:
Robert Lord
2014-06-11 22:10:31 -07:00
parent 5a69760f54
commit 4d4f6efeb8

View File

@@ -722,12 +722,14 @@
if(self.options.scrollHistory) {
if(window.location.hash !== "#" + anchorText) {
// IF STATEMENT ADDED BY ROBERT
if(history.replaceState) {
if(window.location.hash !== "#" + anchorText && anchorText !== undefined) {
if(history.replaceState) {
history.replaceState({}, "", "#" + anchorText);
// provide a fallback
} else {
} else {
scrollV = document.body.scrollTop;
scrollH = document.body.scrollLeft;
location.hash = "#" + anchorText;