Make sure the content is correctly applied in onReady
This commit is contained in:
parent
42b6cca18d
commit
5303e76ece
@ -812,6 +812,7 @@ define([
|
|||||||
$('#' + LOADING).fadeOut(750, cb);
|
$('#' + LOADING).fadeOut(750, cb);
|
||||||
};
|
};
|
||||||
common.errorLoadingScreen = function (error, transparent) {
|
common.errorLoadingScreen = function (error, transparent) {
|
||||||
|
if (!$('#' + LOADING).is(':visible')) { common.addLoadingScreen(); }
|
||||||
$('.spinnerContainer').hide();
|
$('.spinnerContainer').hide();
|
||||||
if (transparent) { $('#' + LOADING).css('opacity', 0.8); }
|
if (transparent) { $('#' + LOADING).css('opacity', 0.8); }
|
||||||
$('#' + LOADING).find('p').html(error || Messages.error);
|
$('#' + LOADING).find('p').html(error || Messages.error);
|
||||||
|
|||||||
@ -342,7 +342,7 @@ define([
|
|||||||
var applyHjson = function (shjson) {
|
var applyHjson = function (shjson) {
|
||||||
var userDocStateDom = hjsonToDom(JSON.parse(shjson));
|
var userDocStateDom = hjsonToDom(JSON.parse(shjson));
|
||||||
|
|
||||||
if (!readOnly) {
|
if (!readOnly && !initializing) {
|
||||||
userDocStateDom.setAttribute("contenteditable", "true"); // lol wtf
|
userDocStateDom.setAttribute("contenteditable", "true"); // lol wtf
|
||||||
}
|
}
|
||||||
var patch = (DD).diff(inner, userDocStateDom);
|
var patch = (DD).diff(inner, userDocStateDom);
|
||||||
@ -686,6 +686,18 @@ define([
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!readOnly) {
|
||||||
|
var shjson2 = stringifyDOM(inner);
|
||||||
|
var hjson2 = JSON.parse(shjson2).slice(0,-1);
|
||||||
|
var hjson = JSON.parse(shjson).slice(0,-1);
|
||||||
|
if (stringify(hjson2) !== stringify(hjson)) {
|
||||||
|
console.log('err');
|
||||||
|
console.error("shjson2 !== shjson");
|
||||||
|
Cryptpad.errorLoadingScreen("Unable to display the content of that realtime session in your browser. Please try to reload that page."); // TODO translate
|
||||||
|
throw new Error();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Cryptpad.getLastName(function (err, lastName) {
|
Cryptpad.getLastName(function (err, lastName) {
|
||||||
console.log("Unlocking editor");
|
console.log("Unlocking editor");
|
||||||
setEditable(true);
|
setEditable(true);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user