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

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Mon Jan 6 18:41:05 UTC 2020


 loleaflet/css/loleaflet.css                   |    8 ++++++++
 loleaflet/src/layer/tile/ImpressTileLayer.js  |   11 +++++++++++
 loleaflet/src/map/handler/Map.TouchGesture.js |   24 ++++++++++++++----------
 3 files changed, 33 insertions(+), 10 deletions(-)

New commits:
commit 697595ee223599669e8c1b577491da5fc8d71d02
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Mon Jan 6 13:26:03 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Mon Jan 6 19:40:59 2020 +0100

    loleaflet: mobile: avoid blurs when graphic is editing
    
    This fixes the annoying effect to blur and focus again
    when the graphic is editing.
    
    Change-Id: I3b26cf0a3aaa6418062121279f65df3753e179a6
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/86289
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/loleaflet/src/map/handler/Map.TouchGesture.js b/loleaflet/src/map/handler/Map.TouchGesture.js
index f59604c82..66c333791 100644
--- a/loleaflet/src/map/handler/Map.TouchGesture.js
+++ b/loleaflet/src/map/handler/Map.TouchGesture.js
@@ -305,11 +305,12 @@ L.Map.TouchGesture = L.Handler.extend({
 		this._map.fire('closepopups');
 		this._map.fire('closemobilewizard');
 
+		var docLayer = this._map._docLayer;
 		// unselect if anything is selected already
-		if (this._map._docLayer && this._map._docLayer._annotations && this._map._docLayer._annotations.unselect) {
-			this._map._docLayer._annotations.unselect();
-			var pointPx = this._map._docLayer._twipsToPixels(mousePos);
-			var bounds = this._map._docLayer._annotations.getBounds();
+		if (docLayer && docLayer._annotations && docLayer._annotations.unselect) {
+			docLayer._annotations.unselect();
+			var pointPx = docLayer._twipsToPixels(mousePos);
+			var bounds = docLayer._annotations.getBounds();
 			if (bounds && bounds.contains(pointPx)) {
 				// not forward mouse events to core if the user tap on a comment box
 				// for instance on Writer that causes the text cursor to be moved
@@ -317,13 +318,16 @@ L.Map.TouchGesture = L.Handler.extend({
 			}
 		}
 		this._map._contextMenu._onMouseDown({originalEvent: e.srcEvent});
-		this._map._docLayer._postMouseEvent('buttondown', mousePos.x, mousePos.y, 1, 1, 0);
-		this._map._docLayer._postMouseEvent('buttonup', mousePos.x, mousePos.y, 1, 1, 0);
 
-		if (this._state === L.Map.TouchGesture.MARKER || this._state === L.Map.TouchGesture.GRAPHIC) {
-			this._map._textInput.blur();
-		} else {
-			this._map.focus();
+		if (docLayer) {
+			docLayer._postMouseEvent('buttondown', mousePos.x, mousePos.y, 1, 1, 0);
+			docLayer._postMouseEvent('buttonup', mousePos.x, mousePos.y, 1, 1, 0);
+
+			if (this._state === L.Map.TouchGesture.MARKER || (this._state === L.Map.TouchGesture.GRAPHIC && !docLayer._isCursorVisible)) {
+				this._map._textInput.blur();
+			} else if (!this._map.hasFocus()) {
+				this._map.focus();
+			}
 		}
 	},
 
commit 23ccef0ac790aedb54c0eaff2ad6c814fc26d5c6
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Tue Dec 17 15:41:26 2019 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Mon Jan 6 19:40:44 2020 +0100

    loleaflet: android: hide slide sorter if it is a small window size
    
    The android browser application changes the orientation when the
    soft keyboard pop ups, it has been given a heuristic number 2/3 screen height
    to hide the slide sorter, this is because there is a header size
    that show the URL bar and it can be improved to the equal screen size of the
    native Android app.
    
    Change-Id: I182795fe698bf191cd5b675c1768820ab78b1602
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/85333
    Reviewed-by: Henry Castro <hcastro at collabora.com>
    Tested-by: Henry Castro <hcastro at collabora.com>

diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css
index 52038a224..7d3326687 100644
--- a/loleaflet/css/loleaflet.css
+++ b/loleaflet/css/loleaflet.css
@@ -301,6 +301,10 @@ body {
 		bottom: 95px;
 		width: 100%;
 	}
+
+	#document-container.parts-preview-document.keyboard {
+		bottom: 33px;
+	}
 }
 
 @media (max-width: 767px) and (orientation: landscape),(max-device-height: 767px) and (orientation: landscape)  {
@@ -325,6 +329,10 @@ body {
 		bottom: 0px;
 		max-width: 120px;
 	}
+
+	#document-container.parts-preview-document.keyboard {
+		left: 0px !important;
+	}
 }
 
 .loleaflet-font {
diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js
index ffa1f40af..92a0bca5f 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -409,6 +409,17 @@ L.ImpressTileLayer = L.TileLayer.extend({
 			return;
 		}
 
+		// Android change the orientation if the keyboard is visible
+		if (L.Browser.android) {
+			if (window.innerHeight < 2 * screen.height / 3) {
+				L.DomUtil.addClass(this._map.options.documentContainer, 'keyboard');
+				$(preview).hide();
+			} else {
+				L.DomUtil.removeClass(this._map.options.documentContainer, 'keyboard');
+				$(preview).show();
+			}
+		}
+
 		if (L.DomUtil.isPortrait() && $(preview).data('mCS').opt.axis !== 'x') {
 			$(preview).mCustomScrollbar('destroy');
 			this._preview.createScrollbar('x');


More information about the Libreoffice-commits mailing list