[Libreoffice-commits] online.git: loleaflet/src
Henry Castro
hcastro at collabora.com
Sun Oct 2 20:57:02 UTC 2016
loleaflet/src/layer/tile/TileLayer.js | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
New commits:
commit 4074587a128587c9f535dbaac4b98e0ccf628823
Author: Henry Castro <hcastro at collabora.com>
Date: Sun Oct 2 16:46:30 2016 -0400
loleaflet: the cell view cursor displays user name
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index b2b1790..061db21 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -665,19 +665,23 @@ L.TileLayer = L.GridLayer.extend({
if (!this._cellViewCursors[viewId] || !this._cellViewCursors[viewId].bounds)
return;
- var cellViewCursorsMarker = this._cellViewCursors[viewId].marker;
+ var cellViewCursorMarker = this._cellViewCursors[viewId].marker;
var viewPart = this._cellViewCursors[viewId].part;
if (!this._isEmptyRectangle(this._cellViewCursors[viewId].bounds) && this._selectedPart === viewPart) {
- if (!cellViewCursorsMarker) {
- cellViewCursorsMarker = L.rectangle(this._cellViewCursors[viewId].bounds, {fill: false, color: L.LOUtil.getViewIdHexColor(viewId), weight: 2});
- this._cellViewCursors[viewId].marker = cellViewCursorsMarker;
+ if (!cellViewCursorMarker) {
+ var borderColor = L.LOUtil.getViewIdHexColor(viewId);
+ cellViewCursorMarker = L.rectangle(this._cellViewCursors[viewId].bounds, {fill: false, color: borderColor, weight: 2});
+ this._cellViewCursors[viewId].marker = cellViewCursorMarker;
+ cellViewCursorMarker.bindPopup(this._map.getViewName(viewId), {autoClose: false, autoPan: false, borderColor: borderColor});
}
- cellViewCursorsMarker.setBounds(this._cellViewCursors[viewId].bounds);
- this._viewLayerGroup.addLayer(cellViewCursorsMarker);
+ else {
+ cellViewCursorMarker.setBounds(this._cellViewCursors[viewId].bounds);
+ }
+ this._viewLayerGroup.addLayer(cellViewCursorMarker);
}
- else if (cellViewCursorsMarker) {
- this._viewLayerGroup.removeLayer(cellViewCursorsMarker);
+ else if (cellViewCursorMarker) {
+ this._viewLayerGroup.removeLayer(cellViewCursorMarker);
}
},
More information about the Libreoffice-commits
mailing list