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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sun Aug 26 18:18:25 UTC 2018


 loleaflet/src/layer/marker/ClipboardContainer.js |    4 ++++
 loleaflet/src/layer/tile/TileLayer.js            |    2 +-
 loleaflet/src/map/handler/Map.Keyboard.js        |    2 +-
 3 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit a6d505ad458b151e673ba2a8c4f8be031549a0b9
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Aug 22 15:53:05 2018 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Sun Aug 26 14:17:51 2018 -0400

    loleaflet: encapsulate activeElement
    
    Change-Id: I21326c075c7a40b96ac946daaf70d488e0d633f9

diff --git a/loleaflet/src/layer/marker/ClipboardContainer.js b/loleaflet/src/layer/marker/ClipboardContainer.js
index cb7b74a9a..4dfddad7e 100644
--- a/loleaflet/src/layer/marker/ClipboardContainer.js
+++ b/loleaflet/src/layer/marker/ClipboardContainer.js
@@ -91,6 +91,10 @@ L.ClipboardContainer = L.Layer.extend({
 		this._textArea.setAttribute('spellcheck', 'false');
 	},
 
+	activeElement: function () {
+		return this._textArea;
+	},
+
 	_setPos: function (pos) {
 		L.DomUtil.setPosition(this._container, pos);
 	}
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index de1269e54..f0e8761a1 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1586,7 +1586,7 @@ L.TileLayer = L.GridLayer.extend({
 	// the state of the document (if the falgs are set)
 	_updateCursorAndOverlay: function (/*update*/) {
 		if (this._map._permission === 'edit'
-		&& this._map._clipboardContainer._textArea === document.activeElement
+		&& this._map._clipboardContainer.activeElement() === document.activeElement
 		&& this._isCursorVisible
 		&& this._isCursorOverlayVisible
 		&& !this._isEmptyRectangle(this._visibleCursor)) {
diff --git a/loleaflet/src/map/handler/Map.Keyboard.js b/loleaflet/src/map/handler/Map.Keyboard.js
index 18e49ad4e..d6466e95c 100644
--- a/loleaflet/src/map/handler/Map.Keyboard.js
+++ b/loleaflet/src/map/handler/Map.Keyboard.js
@@ -252,7 +252,7 @@ L.Map.Keyboard = L.Handler.extend({
 			compEventFn = L.bind(docLayer._postCompositionEvent, docLayer, 0 /* winid */);
 		}
 		if (!inputEle) {
-			inputEle = this._map._clipboardContainer._textArea;
+			inputEle = this._map._clipboardContainer.activeElement();
 		}
 		this.modifier = 0;
 		var shift = e.originalEvent.shiftKey ? this.keyModifier.shift : 0;


More information about the Libreoffice-commits mailing list