set correct hash even if browser does not implement replaceState
This commit is contained in:
1 parent
303c65f2c3
commit
c2770a7a74
5 files changed
+6
-6
No files matched your search
@@ -225,9 +225,9 @@ define([
|
||||
return secret;
|
||||
};
|
||||
|
||||
var setHash = common.setHash = function (hash) {
|
||||
if (!/^#/.test(hash)) { hash = '#' + hash; }
|
||||
var replaceHash = common.replaceHash = function (hash) {
|
||||
if (window.history && window.history.replaceState) {
|
||||
if (!/^#/.test(hash)) { hash = '#' + hash; }
|
||||
return void window.history.replaceState({}, window.document.title, hash);
|
||||
}
|
||||
window.location.hash = hash;
|
||||
|
||||
Reference in new issue
Block a user