Use history API fallback to location hash

this prevents the browser from jumping to the anchor identified by the hash
This commit is contained in:
Achim Hendriks
2014-11-25 22:40:47 +01:00
parent b7d6337dcb
commit f0f85eb005
+6 -1
View File
@@ -538,7 +538,12 @@
if ( settings.updateHash && ! skipUpdateToHash ) {
//window.location = url.toString().replace((url.pathname + hash), (url.pathname + $clicked.attr("href")));
// Not sure why this behaves so differently, but it's more straight forward and seems to have less side-effects
window.location.hash = '#' + $targetPanel.attr('id');
if (window.history.pushState) {
window.history.pushState(null, null, '#' + $targetPanel.attr('id'));
}
else {
window.location.hash = '#' + $targetPanel.attr('id');
}
} else {
skipUpdateToHash = false;
}