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

Jan Holesovsky (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 3 11:25:14 UTC 2020


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

New commits:
commit 60ee81afc2b10e4a376ea6c83ae4790bd20880ea
Author:     Jan Holesovsky <kendy at collabora.com>
AuthorDate: Sat Feb 1 12:27:55 2020 +0100
Commit:     Jan Holesovsky <kendy at 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 <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at 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({


More information about the Libreoffice-commits mailing list