Calc: fix following editor on different sheet

If we follow user who does editing on other part - we need to
switch to it first. Whitout that we failed with error in the
browser console due to missing marker on the screen.

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I3d4150f5c8f70240d3a386a8d5a7fdbc4e8d37d9
This commit is contained in:
Szymon Kłos 2024-05-29 08:52:19 +02:00 committed by Szymon Kłos
parent bf32a3f5dc
commit 11682f1fc8

View file

@ -2577,6 +2577,9 @@ L.CanvasTileLayer = L.Layer.extend({
goToCellViewCursor: function(viewId) {
if (this._cellViewCursors[viewId] && !this._isEmptyRectangle(this._cellViewCursors[viewId].bounds)) {
if (this._selectedPart !== this._cellViewCursors[viewId].part)
this._map.setPart(this._cellViewCursors[viewId].part);
if (!this._map.getBounds().contains(this._cellViewCursors[viewId].bounds)) {
var mapBounds = this._map.getBounds();
var scrollX = 0;
@ -2604,7 +2607,9 @@ L.CanvasTileLayer = L.Layer.extend({
}
var backgroundColor = L.LOUtil.rgbToHex(this._map.getViewColor(viewId));
this._cellViewCursors[viewId].marker.bindPopup(this._map.getViewName(viewId), {autoClose: false, autoPan: false, backgroundColor: backgroundColor, color: 'white', closeButton: false});
var marker = this._cellViewCursors[viewId].marker;
if (marker)
marker.bindPopup(this._map.getViewName(viewId), {autoClose: false, autoPan: false, backgroundColor: backgroundColor, color: 'white', closeButton: false});
}
},