[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-4' - loleaflet/js
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Mar 4 14:48:03 UTC 2019
loleaflet/js/toolbar.js | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
New commits:
commit b101dc4553e2ddb52c654fe021332da94d551216
Author: Tor Lillqvist <tml at collabora.com>
AuthorDate: Wed Dec 19 13:06:16 2018 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Mon Mar 4 15:47:44 2019 +0100
Make the 'closemobile' button (at left, looks like '<') work in the mobile app
We now have two places, the handler for the 'closemobile' button and
the handler for the 'closedocument' menu entry, where we have an if
statement that checks window.ThisIsAMobileApp and if so posts the "BYE"
message to the webkit message handler in the app. Possibly we could
move that conditional code into just one place, down into the 'close'
function in L.Socket instead?
Change-Id: Ib8c6adf621945b266fa4ea5f6d66b0022c2ca373
Reviewed-on: https://gerrit.libreoffice.org/68327
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/loleaflet/js/toolbar.js b/loleaflet/js/toolbar.js
index 04fb0a972..23c26faf8 100644
--- a/loleaflet/js/toolbar.js
+++ b/loleaflet/js/toolbar.js
@@ -290,8 +290,12 @@ function onClick(e, id, item, subItem) {
L.toggleFullScreen();
}
else if (id === 'close' || id === 'closemobile') {
- map.fire('postMessage', {msgId: 'close', args: {EverModified: map._everModified, Deprecated: true}});
- map.fire('postMessage', {msgId: 'UI_Close', args: {EverModified: map._everModified}});
+ if (window.ThisIsAMobileApp) {
+ window.webkit.messageHandlers.lool.postMessage('BYE', '*');
+ } else {
+ map.fire('postMessage', {msgId: 'close', args: {EverModified: map._everModified, Deprecated: true}});
+ map.fire('postMessage', {msgId: 'UI_Close', args: {EverModified: map._everModified}});
+ }
map.remove();
}
else {
More information about the Libreoffice-commits
mailing list