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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Apr 23 10:00:03 UTC 2019


 loleaflet/src/map/Map.js |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit dfd22ba35c00160f00292d6aa0e156d786111d48
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 13 18:05:14 2019 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Apr 23 11:59:45 2019 +0200

    Show progressbar centered in the mobile
    
    When Online was embodied in the nextcloud app (Android)
    the progressbar was moved into top-left corner.
    During a loading all functions to get container
    or browser size were returning (0,0).
    This hack assumed that webview size is almost equal
    to the mobile screen size.
    
    Change-Id: I0fff53639a3baa88b57d91bf671e00ad8c71180d
    Reviewed-on: https://gerrit.libreoffice.org/71117
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 01da473b6..1c3e00096 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -108,7 +108,14 @@ L.Map = L.Evented.extend({
 		}
 		this._addLayers(this.options.layers);
 		this._socket = L.socket(this);
-		this._progressBar = L.progressOverlay(this.getCenter(), L.point(150, 25));
+
+		var center = this.getCenter();
+		if (L.Browser.mobile) {
+			var doubledProgressHeight = 200;
+			var size = new L.point(screen.width, screen.height - doubledProgressHeight);
+			center = this.layerPointToLatLng(size._divideBy(2));
+		}
+		this._progressBar = L.progressOverlay(center, new L.point(150, 25));
 
 		if (L.Browser.mobile) {
 			this._clipboardContainer = L.control.mobileInput().addTo(this);


More information about the Libreoffice-commits mailing list