loleaflet/js/toolbar.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
New commits: commit b101dc4553e2ddb52c654fe021332da94d551216 Author: Tor Lillqvist <t...@collabora.com> AuthorDate: Wed Dec 19 13:06:16 2018 +0200 Commit: Andras Timar <andras.ti...@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.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@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 { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits