|
|
@ -2202,20 +2202,22 @@ define([
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var wasEditing = false;
|
|
|
|
var setStrictEditing = function () {
|
|
|
|
var setStrictEditing = function () {
|
|
|
|
if (APP.isFast) { return; }
|
|
|
|
if (APP.isFast) { return; }
|
|
|
|
var editor = getEditor();
|
|
|
|
var editor = getEditor();
|
|
|
|
var isModified = editor.asc_isDocumentModified || editor.isDocumentModified;
|
|
|
|
var editing = editor.asc_isDocumentModified ? editor.asc_isDocumentModified() : editor.isDocumentModified();
|
|
|
|
var editing = isModified();
|
|
|
|
|
|
|
|
if (editing) {
|
|
|
|
if (editing) {
|
|
|
|
evOnPatch.fire();
|
|
|
|
evOnPatch.fire();
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
evOnSync.fire();
|
|
|
|
evOnSync.fire();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
wasEditing = Boolean(editing);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
APP.onFastChange = function (isFast) {
|
|
|
|
APP.onFastChange = function (isFast) {
|
|
|
|
APP.isFast = isFast;
|
|
|
|
APP.isFast = isFast;
|
|
|
|
if (isFast) {
|
|
|
|
if (isFast) {
|
|
|
|
|
|
|
|
wasEditing = false;
|
|
|
|
if (APP.hasChangedInterval) {
|
|
|
|
if (APP.hasChangedInterval) {
|
|
|
|
window.clearInterval(APP.hasChangedInterval);
|
|
|
|
window.clearInterval(APP.hasChangedInterval);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2562,6 +2564,7 @@ define([
|
|
|
|
sframeChan.event("EV_CORRUPTED_CACHE");
|
|
|
|
sframeChan.event("EV_CORRUPTED_CACHE");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var firstReady = true;
|
|
|
|
config.onReady = function (info) {
|
|
|
|
config.onReady = function (info) {
|
|
|
|
if (APP.realtime !== info.realtime) {
|
|
|
|
if (APP.realtime !== info.realtime) {
|
|
|
|
APP.realtime = info.realtime;
|
|
|
|
APP.realtime = info.realtime;
|
|
|
@ -2671,8 +2674,12 @@ define([
|
|
|
|
setMyId();
|
|
|
|
setMyId();
|
|
|
|
oldHashes = JSON.parse(JSON.stringify(content.hashes));
|
|
|
|
oldHashes = JSON.parse(JSON.stringify(content.hashes));
|
|
|
|
initializing = false;
|
|
|
|
initializing = false;
|
|
|
|
common.openPadChat(APP.onLocal);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Only execute the following code the first time we call onReady
|
|
|
|
|
|
|
|
if (!firstReady) { return void setEditable(!readOnly); }
|
|
|
|
|
|
|
|
firstReady = false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
common.openPadChat(APP.onLocal);
|
|
|
|
|
|
|
|
|
|
|
|
if (!readOnly) {
|
|
|
|
if (!readOnly) {
|
|
|
|
var cursors = {};
|
|
|
|
var cursors = {};
|
|
|
|