diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 6c2d9332f..ef43b06b0 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -1350,7 +1350,7 @@ define([ // Migration required but read-only: continue... if (readOnly) { setEditable(true); - getEditor().setViewModeDisconnect(); + try { getEditor().asc_setRestriction(true); } catch (e) {} } else { // No changes after the cp: migrate now onMigrateRdy.fire(); @@ -1376,9 +1376,7 @@ define([ } if (lock || readOnly) { - try { - getEditor().asc_setRestriction(true); - } catch (e) {} + try { getEditor().asc_setRestriction(true); } catch (e) {} //getEditor().setViewModeDisconnect(); // can't be used anymore, display an OO error popup } else { setEditable(true); @@ -1408,7 +1406,8 @@ define([ } if (APP.template) { - getEditor().setViewModeDisconnect(); + try { getEditor().asc_setRestriction(true); } catch (e) {} + //getEditor().setViewModeDisconnect(); UI.removeLoadingScreen(); makeCheckpoint(true); return; @@ -1977,7 +1976,7 @@ define([ UI.removeModals(); UI.confirm(Messages.oo_uploaded, function (yes) { try { - getEditor().setViewModeDisconnect(); + getEditor().asc_setRestriction(true); } catch (e) {} if (!yes) { return; } common.gotoURL(); @@ -2143,7 +2142,9 @@ define([ APP.history = true; APP.template = true; var editor = getEditor(); - if (editor) { editor.setViewModeDisconnect(); } + if (editor) { + try { getEditor().asc_setRestriction(true); } catch (e) {} + } var content = parsed.content; // Get checkpoint @@ -2282,7 +2283,7 @@ define([ var setHistoryMode = function (bool) { if (bool) { APP.history = true; - getEditor().setViewModeDisconnect(); + try { getEditor().asc_setRestriction(true); } catch (e) {} return; } // Cancel button: redraw from lastCp