[Libreoffice-commits] online.git: loleaflet/src
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Sep 12 11:16:00 UTC 2018
loleaflet/src/control/Control.MobileInput.js | 8 +++++++-
loleaflet/src/layer/marker/ClipboardContainer.js | 4 ++++
loleaflet/src/layer/tile/TileLayer.js | 4 +---
3 files changed, 12 insertions(+), 4 deletions(-)
New commits:
commit b29f75f49fcfbce2dc19eb929883923c11c53f8c
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Sep 12 07:10:53 2018 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Wed Sep 12 07:15:15 2018 -0400
loleaflet: delegate clip container to show the cursor
Change-Id: I80d556d9e29cfa2ced0afcf985d41862ecd98ba5
diff --git a/loleaflet/src/control/Control.MobileInput.js b/loleaflet/src/control/Control.MobileInput.js
index 65351edaa..1b5bc57b9 100644
--- a/loleaflet/src/control/Control.MobileInput.js
+++ b/loleaflet/src/control/Control.MobileInput.js
@@ -17,7 +17,7 @@ L.Control.MobileInput = L.Control.extend({
},
onGotFocus: function () {
- this._map._docLayer._updateCursorPos();
+ this._map.addLayer(this._map._docLayer._cursorMarker);
},
onLostFocus: function () {
@@ -57,6 +57,12 @@ L.Control.MobileInput = L.Control.extend({
return this._textArea;
},
+ showCursor: function () {
+ if (this._textArea === document.activeElement) {
+ this.onGotFocus();
+ }
+ },
+
_initLayout: function () {
var tagTd = 'td',
constOff = 'off',
diff --git a/loleaflet/src/layer/marker/ClipboardContainer.js b/loleaflet/src/layer/marker/ClipboardContainer.js
index b402eda64..2cc5deb0d 100644
--- a/loleaflet/src/layer/marker/ClipboardContainer.js
+++ b/loleaflet/src/layer/marker/ClipboardContainer.js
@@ -79,6 +79,10 @@ L.ClipboardContainer = L.Layer.extend({
return this._textArea;
},
+ showCursor: function () {
+ this._map.addLayer(this._map._docLayer._cursorMarker);
+ },
+
_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 116a316c4..c315b9399 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1549,8 +1549,7 @@ L.TileLayer = L.GridLayer.extend({
this._cursorMarker.setLatLng(cursorPos, pixBounds.getSize().multiplyBy(this._map.getZoomScale(this._map.getZoom())));
}
- this._map.addLayer(this._cursorMarker);
- return this._visibleCursor.getNorthWest();
+ this._map._clipboardContainer.showCursor();
},
// Update cursor layer (blinking cursor).
@@ -1585,7 +1584,6 @@ 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.activeElement() === document.activeElement
&& this._isCursorVisible
&& this._isCursorOverlayVisible
&& !this._isEmptyRectangle(this._visibleCursor)) {
More information about the Libreoffice-commits
mailing list