[Libreoffice-commits] online.git: Branch 'distro/collabora/collabora-online-3-0' - loleaflet/dist loleaflet/src

Pranav Kant pranavk at collabora.co.uk
Thu Feb 15 14:25:27 UTC 2018


 loleaflet/dist/leaflet.css            |    4 ++--
 loleaflet/src/layer/tile/TileLayer.js |    5 +++++
 loleaflet/src/map/Map.js              |    3 ++-
 3 files changed, 9 insertions(+), 3 deletions(-)

New commits:
commit 33665347bc3ade2d977ce40b5927f7f48d0538df
Author: Pranav Kant <pranavk at collabora.co.uk>
Date:   Thu Feb 8 15:04:29 2018 +0530

    Move the IME candidate window with cursor position
    
    Change-Id: I7b37b0c4981b4ebcefb7606915711ca2adec3c31
    (cherry picked from commit 1e91799663945fdfde84385bcfbb96fd03c6fe2e)
    Reviewed-on: https://gerrit.libreoffice.org/49775
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/loleaflet/dist/leaflet.css b/loleaflet/dist/leaflet.css
index c324ebfd..b2bf8115 100644
--- a/loleaflet/dist/leaflet.css
+++ b/loleaflet/dist/leaflet.css
@@ -679,7 +679,7 @@ div.leaflet-cursor-container:hover > .leaflet-cursor-header {
 }
 
 .clipboard-container {
-	position: fixed;
+	position: absolute;
 	left: 0px;
 	top: 0px;
 	width: 0px;
@@ -863,4 +863,4 @@ div.leaflet-cursor-container:hover > .leaflet-cursor-header {
 	border-radius: 2px;
 	top: 24px;
 	color: white;
-	}
\ No newline at end of file
+	}
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 0ac34006..a4b95dbc 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1438,6 +1438,11 @@ L.TileLayer = L.GridLayer.extend({
 				this._cursorMarker.setLatLng(cursorPos, pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())));
 			}
 			this._map.addLayer(this._cursorMarker);
+
+			// move the hidden input field with the cursor
+			var clipContainer = L.DomUtil.get('doc-clipboard-container');
+			var pos = this._map.latLngToLayerPoint(L.latLng(cursorPos)).round();
+			L.DomUtil.setPosition(clipContainer, pos);
 		}
 		else if (this._cursorMarker) {
 			this._map.removeLayer(this._cursorMarker);
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 10f5acfd..ad092edc 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -692,7 +692,8 @@ L.Map = L.Evented.extend({
 			throw new Error('Map container is already initialized.');
 		}
 
-		var textAreaContainer = L.DomUtil.create('div', 'clipboard-container', container.parentElement);
+		var textAreaContainer = L.DomUtil.create('div', 'clipboard-container', container);
+		textAreaContainer.id = 'doc-clipboard-container';
 		this._textArea = L.DomUtil.create('input', 'clipboard', textAreaContainer);
 		this._textArea.setAttribute('type', 'text');
 		this._textArea.setAttribute('autocorrect', 'off');


More information about the Libreoffice-commits mailing list