diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 6ae9a2a27..f87cff136 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -2668,16 +2668,22 @@ define([ } + // Only execute the following code the first time we call onReady + if (!firstReady) { + setMyId(); + oldHashes = JSON.parse(JSON.stringify(content.hashes)); + initializing = false; + return void setEditable(!readOnly); + } + firstReady = false; + + var useNewDefault = content.version && content.version >= 2; openRtChannel(function () { setMyId(); oldHashes = JSON.parse(JSON.stringify(content.hashes)); initializing = false; - // 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) { @@ -2836,10 +2842,12 @@ define([ common.gotoURL(); }); } - setEditable(true); + //setEditable(true); + try { getEditor().asc_setViewMode(false); } catch (e) {} offline = false; } else { - setEditable(false); + try { getEditor().asc_setViewMode(true); } catch (e) {} + //setEditable(false); offline = true; UI.findOKButton().click(); UIElements.disconnectAlert();