loleaflet/src/control/Control.LokDialog.js |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit eb8e075ce02e54da4f5eca86157919001978cda0
Author:     gokaysatir <[email protected]>
AuthorDate: Wed Aug 12 17:20:54 2020 +0300
Commit:     Henry Castro <[email protected]>
CommitDate: Thu Aug 13 21:08:24 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 <[email protected]>
    Reviewed-by: Henry Castro <[email protected]>

diff --git a/loleaflet/src/control/Control.LokDialog.js 
b/loleaflet/src/control/Control.LokDialog.js
index 3332c53ed..40e422e02 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -991,6 +991,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())
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to