[Libreoffice-commits] online.git: 2 commits - loleaflet/dist loleaflet/src
Pranav Kant
pranavk at collabora.co.uk
Tue Mar 27 12:47:06 UTC 2018
loleaflet/dist/loleaflet.css | 1 +
loleaflet/src/control/Ruler.js | 4 ++--
loleaflet/src/layer/tile/TileLayer.js | 20 ++++++++++++++++----
loleaflet/src/map/Map.js | 4 ++++
4 files changed, 23 insertions(+), 6 deletions(-)
New commits:
commit b2fd459486425524aafd8cc08807af84f3c086a3
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Mon Mar 26 16:29:24 2018 +0530
missing semi-colons
Change-Id: Ic783fde87b8939152b76264626ec9476df81b2ff
diff --git a/loleaflet/src/control/Ruler.js b/loleaflet/src/control/Ruler.js
index df702e05d..31de43582 100644
--- a/loleaflet/src/control/Ruler.js
+++ b/loleaflet/src/control/Ruler.js
@@ -129,9 +129,9 @@ L.Control.Ruler = L.Control.extend({
this._rMarginMarker = L.DomUtil.create('div', classMargin + ' ' + rightComp, this._rFace);
this._lMarginDrag = L.DomUtil.create('div', classDraggable + ' ' + leftComp, this._rMarginWrapper);
- this._lToolTip = L.DomUtil.create('div', lToolTip, this._lMarginDrag)
+ this._lToolTip = L.DomUtil.create('div', lToolTip, this._lMarginDrag);
this._rMarginDrag = L.DomUtil.create('div', classDraggable + ' ' + rightComp, this._rMarginWrapper);
- this._rToolTip = L.DomUtil.create('div', rToolTip, this._rMarginDrag)
+ this._rToolTip = L.DomUtil.create('div', rToolTip, this._rMarginDrag);
this._lMarginDrag.title = leftMarginStr;
this._rMarginDrag.title = rightMarginStr;
}
commit 5437eee548b3406d2d993cd83669c1b90ea46155
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Mar 22 19:18:46 2018 +0530
loleaflet: avoid getting browser scrollbar
while keeping the position of hidden input field to be around the
cursor.
Change-Id: I5539cc5c8e99526b771be0e11336dd6d77e5b02c
diff --git a/loleaflet/dist/loleaflet.css b/loleaflet/dist/loleaflet.css
index 36df3e052..8f67261c0 100644
--- a/loleaflet/dist/loleaflet.css
+++ b/loleaflet/dist/loleaflet.css
@@ -44,6 +44,7 @@
body {
margin: 0;
+ overflow: hidden;
}
#presentation-controls-wrapper {
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 72318ae1d..d6df423db 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1540,10 +1540,7 @@ L.TileLayer = L.GridLayer.extend({
}
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.latLngToContainerPoint(L.latLng(cursorPos)).round();
- L.DomUtil.setPosition(clipContainer, pos);
+ this._updateContainerElements();
}
else if (this._cursorMarker) {
this._map.removeLayer(this._cursorMarker);
@@ -1551,6 +1548,21 @@ L.TileLayer = L.GridLayer.extend({
}
},
+ _updateContainerElements: function() {
+ var clipContainer = L.DomUtil.get('doc-clipboard-container');
+ if (!this._visibleCursor ||
+ !clipContainer)
+ return;
+
+ var oldPos = L.DomUtil.getPosition(clipContainer);
+ var newPos = this._map.latLngToContainerPoint(L.latLng(this._visibleCursor.getNorthWest())).round();
+ if (!oldPos || oldPos.x !== newPos.x || oldPos.y !== newPos.y) {
+ // move the hidden input field with the cursor
+ console.log('_updateContainerElements: ' + newPos);
+ L.DomUtil.setPosition(clipContainer, newPos);
+ }
+ },
+
// Update colored non-blinking view cursor
_onUpdateViewCursor: function (viewId) {
if (typeof this._viewCursors[viewId] !== 'object' ||
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index b8e4f1d37..6790b1cb3 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -794,6 +794,10 @@ L.Map = L.Evented.extend({
_rawPanBy: function (offset) {
L.DomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(offset));
+
+ if (this._docLayer) {
+ this._docLayer._updateContainerElements();
+ }
},
_getZoomSpan: function () {
More information about the Libreoffice-commits
mailing list