[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/css loleaflet/src

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Wed Jul 15 12:37:34 UTC 2020


 loleaflet/css/toolbar.css                |    1 -
 loleaflet/src/control/Control.Menubar.js |    2 +-
 loleaflet/src/control/Control.Toolbar.js |    5 +++--
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 8055b2c4b035a7fd70a989bb1ad6cb1ad842443f
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Thu Jul 9 10:53:48 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Wed Jul 15 14:37:14 2020 +0200

    loleaflet: fix the show/hide close button
    
    Explicit show/hide the close button if the page is loaded by
    a WOPI Integrator.
    
    Change-Id: I13d58bbbff03f283ed033a12a4489b610839748e
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98443
    Tested-by: Jenkins
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/98798

diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css
index 0a795e187..ff228e7eb 100644
--- a/loleaflet/css/toolbar.css
+++ b/loleaflet/css/toolbar.css
@@ -230,7 +230,6 @@ td[id^=tb_editbar_item_sidebar]{
 }
 
 .closebuttonimage {
-		display: none;
 		background: url('images/closedoc.svg') no-repeat center !important;
 }
 
diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 3eea9a713..e1b76779a 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -1360,7 +1360,7 @@ L.Control.Menubar = L.Control.extend({
 
 		if (menuItem.type === 'action') {
 			if ((menuItem.id === 'rev-history' && !L.Params.revHistoryEnabled) ||
-				(menuItem.id === 'closedocument' && !window.closebutton) ||
+				(menuItem.id === 'closedocument' && !L.Params.closeButtonEnabled) ||
 				(menuItem.id === 'latest-updates' && !window.enableWelcomeMessage)) {
 				return false;
 			}
diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js
index 500ca36b5..6a52c4ec1 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -1058,11 +1058,12 @@ function setupToolbar(e) {
 	map.on('commandresult', onCommandResult);
 	map.on('updateparts pagenumberchanged', onUpdateParts);
 
-	if (!L.Params.closeButtonEnabled) {
+	if (map.options.wopi && L.Params.closeButtonEnabled) {
+		$('#closebuttonwrapper').show();
+	} else if (!L.Params.closeButtonEnabled) {
 		$('#closebuttonwrapper').hide();
 	} else if (L.Params.closeButtonEnabled && !window.mode.isMobile()) {
 		$('#closebuttonwrapper').show();
-		$('.closebuttonimage').show();
 	}
 
 	$('#closebutton').click(function() {


More information about the Libreoffice-commits mailing list