set correct hash even if browser does not implement replaceState
This commit is contained in:
parent
303c65f2c3
commit
c2770a7a74
@ -495,7 +495,7 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set the hash
|
// set the hash
|
||||||
if (!readOnly) { Cryptpad.setHash(editHash); }
|
if (!readOnly) { Cryptpad.replaceHash(editHash); }
|
||||||
|
|
||||||
Cryptpad.getPadTitle(function (err, title) {
|
Cryptpad.getPadTitle(function (err, title) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
@ -225,9 +225,9 @@ define([
|
|||||||
return secret;
|
return secret;
|
||||||
};
|
};
|
||||||
|
|
||||||
var setHash = common.setHash = function (hash) {
|
var replaceHash = common.replaceHash = function (hash) {
|
||||||
if (!/^#/.test(hash)) { hash = '#' + hash; }
|
|
||||||
if (window.history && window.history.replaceState) {
|
if (window.history && window.history.replaceState) {
|
||||||
|
if (!/^#/.test(hash)) { hash = '#' + hash; }
|
||||||
return void window.history.replaceState({}, window.document.title, hash);
|
return void window.history.replaceState({}, window.document.title, hash);
|
||||||
}
|
}
|
||||||
window.location.hash = hash;
|
window.location.hash = hash;
|
||||||
|
|||||||
@ -601,7 +601,7 @@ define([
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set the hash
|
// set the hash
|
||||||
if (!readOnly) { Cryptpad.setHash(editHash); }
|
if (!readOnly) { Cryptpad.replaceHash(editHash); }
|
||||||
|
|
||||||
Cryptpad.getPadTitle(function (err, title) {
|
Cryptpad.getPadTitle(function (err, title) {
|
||||||
if (err) {
|
if (err) {
|
||||||
|
|||||||
@ -914,7 +914,7 @@ define([
|
|||||||
editHash = Cryptpad.getEditHashFromKeys(info.channel, secret.keys);
|
editHash = Cryptpad.getEditHashFromKeys(info.channel, secret.keys);
|
||||||
}
|
}
|
||||||
// set the hash
|
// set the hash
|
||||||
if (!readOnly) { Cryptpad.setHash(editHash); }
|
if (!readOnly) { Cryptpad.replaceHash(editHash); }
|
||||||
|
|
||||||
module.patchText = TextPatcher.create({
|
module.patchText = TextPatcher.create({
|
||||||
realtime: realtime,
|
realtime: realtime,
|
||||||
|
|||||||
@ -585,7 +585,7 @@ define([
|
|||||||
|
|
||||||
// set the hash
|
// set the hash
|
||||||
if (!window.location.hash || window.location.hash === '#') {
|
if (!window.location.hash || window.location.hash === '#') {
|
||||||
Cryptpad.setHash(editHash);
|
Cryptpad.replaceHash(editHash);
|
||||||
}
|
}
|
||||||
|
|
||||||
Cryptpad.getPadTitle(function (err, title) {
|
Cryptpad.getPadTitle(function (err, title) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user