From 0f085e22dcbcfcc26ac2316afd30b395eb3ce341 Mon Sep 17 00:00:00 2001 From: yflory Date: Thu, 23 Jan 2020 17:24:38 +0100 Subject: [PATCH] Update inner.js to use the new OO fixes --- www/common/onlyoffice/inner.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 53ff82307..f204a3a68 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -227,9 +227,13 @@ define([ cpIndex: 0 }; + var getEditor = function () { + return window.frames[0].editor || window.frames[0].editorCell; + }; + var getContent = function () { try { - return window.frames[0].editor.asc_nativeGetFile(); + return getEditor().asc_nativeGetFile(); } catch (e) { console.error(e); return; @@ -242,7 +246,7 @@ define([ // loadable by users joining after the checkpoint var fixSheets = function () { try { - var editor = window.frames[0].editor; + var editor = getEditor(); // if we are not in the sheet app // we should not call this code if (typeof editor.GetSheets === 'undefined') { return; } @@ -1173,7 +1177,7 @@ define([ UI.removeModals(); UI.confirm(Messages.oo_uploaded, function (yes) { try { - window.frames[0].editor.setViewModeDisconnect(); + getEditor().setViewModeDisconnect(); } catch (e) {} if (!yes) { return; } common.gotoURL(); @@ -1303,7 +1307,7 @@ define([ var setEditable = function (state) { if (!state) { try { - window.frames[0].editor.setViewModeDisconnect(true); + getEditor().setViewModeDisconnect(true); } catch (e) {} } debug(state);