loleaflet/src/layer/tile/TileLayer.TableOverlay.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
New commits: commit 88d9e8a7fbfdb8056588040a77cdc9a5716ce860 Author: Henry Castro <hcas...@collabora.com> AuthorDate: Sat Feb 8 10:24:04 2020 -0400 Commit: Henry Castro <hcas...@collabora.com> CommitDate: Sat Feb 8 23:42:21 2020 +0100 loleaflet: mobile: don't show the table selector handlers when it is read only Change-Id: I98d58a872921f442cf3b7318798d985985191c88 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88267 Reviewed-by: Michael Meeks <michael.me...@collabora.com> Tested-by: Michael Meeks <michael.me...@collabora.com> diff --git a/loleaflet/src/layer/tile/TileLayer.TableOverlay.js b/loleaflet/src/layer/tile/TileLayer.TableOverlay.js index 98a188dfd..79fde60eb 100644 --- a/loleaflet/src/layer/tile/TileLayer.TableOverlay.js +++ b/loleaflet/src/layer/tile/TileLayer.TableOverlay.js @@ -105,8 +105,8 @@ L.TileLayer.include({ marker.on('dragstart drag dragend', this._onTableBorderResizeMarkerDrag, this); return marker; }, - _updateTableMarkers: function() { - // Clean-up first + + _clearTableMarkers: function() { var markerIndex; for (markerIndex = 0; markerIndex < this._tableColumnMarkers.length; markerIndex++) { this._map.removeLayer(this._tableColumnMarkers[markerIndex]); @@ -129,6 +129,11 @@ L.TileLayer.include({ this._tableSelectionRowMarkers = []; this._map.removeLayer(this._tableMoveMarker); + }, + + _updateTableMarkers: function() { + // Clean-up first + this._clearTableMarkers(); // Create markers if (this._currentTableData.rows && this._currentTableData.rows.entries.length > 0 && this._currentTableData.columns && this._currentTableData.columns.entries.length > 0) { @@ -208,6 +213,11 @@ L.TileLayer.include({ this._updateTableMarkers(); }, _onTableSelectedMsg: function (textMsg) { + if (this._map._permission !== 'edit') { + this._clearTableMarkers(); + return; + } + if (this._tableMarkersDragged == true) { return; } @@ -358,7 +368,7 @@ L.TileLayer.include({ e.originalEvent.preventDefault(); }, _onTableMoveMarkerDrag: function (event) { - var mouseEvent; + var mouseEvent; if (this._graphicMarker == null) return; if (event.type == 'dragstart') { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits