loleaflet/src/control/Control.AlertDialog.js |   23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

New commits:
commit 60ee81afc2b10e4a376ea6c83ae4790bd20880ea
Author:     Jan Holesovsky <ke...@collabora.com>
AuthorDate: Sat Feb 1 12:27:55 2020 +0100
Commit:     Jan Holesovsky <ke...@collabora.com>
CommitDate: Mon Feb 3 12:24:50 2020 +0100

    android: Close the app when we fail to load the document.
    
    After user has chosen to close it, of course.
    
    Change-Id: I82fcabdae5b0f0c96b4a1101a5f55856c8dd2c60
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87800
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Jan Holesovsky <ke...@collabora.com>

diff --git a/loleaflet/src/control/Control.AlertDialog.js 
b/loleaflet/src/control/Control.AlertDialog.js
index a1665eb08..c73d87d92 100644
--- a/loleaflet/src/control/Control.AlertDialog.js
+++ b/loleaflet/src/control/Control.AlertDialog.js
@@ -19,7 +19,26 @@ L.Control.AlertDialog = L.Control.extend({
                }
 
                if (e.msg) {
-                       vex.dialog.alert(e.msg);
+                       if (window.ThisIsAMobileApp && this._map._fatal) {
+                               var buttonsList = [];
+                               buttonsList.push({
+                                       text: _('Close'),
+                                       type: 'button',
+                                       className: 'vex-dialog-button-primary',
+                                       click: function openClick () {
+                                               window.postMobileMessage('BYE');
+                                               vex.closeAll();
+                                       }
+                               });
+
+                               vex.dialog.alert({
+                                       message: e.msg,
+                                       buttons: buttonsList,
+                                       callback: function() {},
+                               });
+                       }
+                       else
+                               vex.dialog.alert(e.msg);
                }
                else if (e.cmd == 'load' && e.kind == 'docunloading') {
                        // Handled by transparently retrying.
@@ -35,7 +54,7 @@ L.Control.AlertDialog = L.Control.extend({
                        }
 
                        messageText = messageText.replace('%url', url);
-                       var buttonsList = [];
+                       buttonsList = [];
 
                        if (isLinkValid) {
                                buttonsList.push({
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to