From 0036ca88613b4732b5a93bea7724d1792dc01447 Mon Sep 17 00:00:00 2001 From: yflory Date: Tue, 12 May 2020 15:27:00 +0200 Subject: [PATCH] Fix view mode in sheets --- www/common/onlyoffice/inner.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/www/common/onlyoffice/inner.js b/www/common/onlyoffice/inner.js index 89c5acf01..edd8eec81 100644 --- a/www/common/onlyoffice/inner.js +++ b/www/common/onlyoffice/inner.js @@ -930,7 +930,7 @@ if (hasDrawings) { "id": String(myOOId), //"c0c3bf82-20d7-4663-bf6d-7fa39c598b1d", "firstname": metadataMgr.getUserData().name || Messages.anonymous, }, - "mode": lock ? "view" : "edit", + "mode": "edit", "lang": (navigator.language || navigator.userLanguage || '').slice(0,2) }, "events": { @@ -987,7 +987,15 @@ if (hasDrawings) { APP.onLocal(); handleNewLocks(oldLocks, content.locks || {}); // Allow edition - setEditable(true); + + if (lock) { + setTimeout(function () { + setEditable(true); + getEditor().setViewModeDisconnect(); + }, 5000); + } else { + setEditable(true); + } if (isLockedModal.modal && force) { isLockedModal.modal.closeModal();