[Libreoffice-commits] online.git: loleaflet/src

Tor Lillqvist (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 15 21:19:23 UTC 2020


 loleaflet/src/control/Control.Toolbar.js |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 9a4c6a61e47703a91165805208ca026c49063698
Author:     Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Apr 15 18:09:39 2020 +0300
Commit:     Tor Lillqvist <tml at collabora.com>
CommitDate: Wed Apr 15 23:19:04 2020 +0200

    Make the "X" closebutton work also in the mobile apps
    
    In normal cases it will not show up, but due to what is arguably a
    bug, it sometimes shows up anyway. For instance, when you use the app
    in split view on a tablet. So make the button work also in a mobile
    app by posting the same 'BYE' message as done for the "<" closemobile
    button.
    
    Change-Id: Ifdc687ab734fa5e092999d94bd19fe1572281af9
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92285
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Tor Lillqvist <tml at collabora.com>

diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js
index b546c7011..428b4c74b 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -1713,10 +1713,14 @@ function setupToolbar(e) {
 	}
 
 	$('#closebutton').click(function() {
-		map.fire('postMessage', {msgId: 'close', args: {EverModified: map._everModified, Deprecated: true}});
-		map.fire('postMessage', {msgId: 'UI_Close', args: {EverModified: map._everModified}});
-		if (!map._disableDefaultAction['UI_Close']) {
-			map.remove();
+		if (window.ThisIsAMobileApp) {
+			window.postMobileMessage('BYE');
+		} else {
+			map.fire('postMessage', {msgId: 'close', args: {EverModified: map._everModified, Deprecated: true}});
+			map.fire('postMessage', {msgId: 'UI_Close', args: {EverModified: map._everModified}});
+			if (!map._disableDefaultAction['UI_Close']) {
+				map.remove();
+			}
 		}
 	});
 }


More information about the Libreoffice-commits mailing list