[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/src
gokaysatir (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 18 19:49:21 UTC 2020
loleaflet/src/control/Control.LokDialog.js | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit e07f47d2486a07826bfa025cd2d47b267474848c
Author: gokaysatir <gokaysatir at collabora.com>
AuthorDate: Wed Aug 12 17:20:54 2020 +0300
Commit: Aron Budea <aron.budea at collabora.com>
CommitDate: Tue Aug 18 21:49:03 2020 +0200
loleaflet: Prevent sidebar from opening when file is on read only mode.
This patch is for preventing sidebar from being launched when:
* Document is on read only mode (No need for an editor bar when doc is read-only).
* Also the main reason for this patch was to hide Sidebar when revision history is open (NC).
Change-Id: I4d78c65a7e8f39b0827b9e23ecc24fcd9520fef8
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100601
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Henry Castro <hcastro at collabora.com>
(cherry picked from commit eb8e075ce02e54da4f5eca86157919001978cda0)
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100933
Reviewed-by: Aron Budea <aron.budea at collabora.com>
diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index 57b5fdc95..117ae0873 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -1009,6 +1009,11 @@ L.Control.LokDialog = L.Control.extend({
},
_launchSidebar: function(id, width, height) {
+ // In read-only mode, we don't need to show sidebar. This if clause prevents sidebar from opening also when revision history is open.
+ if (this._map.isPermissionReadOnly()) {
+ return;
+ }
+
console.log('_launchSidebar: start: id: ' + id + ', width: ' + width + ', height: ' + height);
if ((window.mode.isMobile() || window.mode.isTablet())
&& !this._map.isPermissionEdit())
More information about the Libreoffice-commits
mailing list