diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index f9ed15f60..5ac3da269 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -104,10 +104,14 @@ define([ return metadataMgr.getNetfluxId() + '-' + privateData.clientId; }; + var getEditor = function () { + return window.frames[0].editor || window.frames[0].editorCell; + }; + var setEditable = function (state) { $('#cp-app-oo-editor').find('#cp-app-oo-offline').remove(); try { - window.frames[0].editor.asc_setViewMode(!state); + getEditor().asc_setViewMode(!state); //window.frames[0].editor.setViewModeDisconnect(true); } catch (e) {} if (!state && !readOnly) { @@ -241,10 +245,6 @@ define([ cpIndex: 0 }; - var getEditor = function () { - return window.frames[0].editor || window.frames[0].editorCell; - }; - var getContent = function () { try { return getEditor().asc_nativeGetFile(); @@ -847,7 +847,7 @@ define([ "id": String(myOOId), //"c0c3bf82-20d7-4663-bf6d-7fa39c598b1d", "firstname": metadataMgr.getUserData().name || Messages.anonymous, }, - "mode": readOnly || lock ? "view" : "edit", + "mode": lock ? "view" : "edit", "lang": (navigator.language || navigator.userLanguage || '').slice(0,2) }, "events": {