Fix 'readonly' mode after disconnection in onlyoffice

pull/1/head
yflory 5 years ago
parent 2c4c18bef6
commit a4d1b47a4c

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

Loading…
Cancel
Save