[Libreoffice-commits] online.git: loleaflet/src
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Tue Jul 21 12:08:51 UTC 2020
loleaflet/src/layer/tile/TileLayer.js | 24 +++++-------------------
1 file changed, 5 insertions(+), 19 deletions(-)
New commits:
commit e86007a4c89cbb181796da78fda8839db66f5891
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Tue Jul 21 13:30:47 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Tue Jul 21 14:08:31 2020 +0200
Simplify code.
Change-Id: I74340aba3e82810599c2da60001e87aaf58cae7d
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/99133
Tested-by: Jenkins
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index c4a18db31..c348a9517 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -3154,15 +3154,8 @@ L.TileLayer = L.GridLayer.extend({
_onUpdateTextSelection: function () {
this._onUpdateCellResizeMarkers();
- var startMarker, endMarker;
- for (var key in this._selectionHandles) {
- if (key === 'start') {
- startMarker = this._selectionHandles[key];
- }
- else if (key === 'end') {
- endMarker = this._selectionHandles[key];
- }
- }
+ var startMarker = this._selectionHandles['start'];
+ var endMarker = this._selectionHandles['end'];
if (this._map.editorHasFocus() && (this._selections.getLayers().length !== 0 || startMarker.isDragged || endMarker.isDragged)) {
if (!startMarker || !endMarker ||
@@ -3176,7 +3169,7 @@ L.TileLayer = L.GridLayer.extend({
this._textSelectionStart = null;
this._textSelectionEnd = null;
this._selectedTextContent = '';
- for (key in this._selectionHandles) {
+ for (var key in this._selectionHandles) {
this._map.removeLayer(this._selectionHandles[key]);
this._selectionHandles[key].isDragged = false;
}
@@ -3184,15 +3177,8 @@ L.TileLayer = L.GridLayer.extend({
},
_updateMarkers: function() {
- var startMarker, endMarker;
- for (var key in this._selectionHandles) {
- if (key === 'start') {
- startMarker = this._selectionHandles[key];
- }
- else if (key === 'end') {
- endMarker = this._selectionHandles[key];
- }
- }
+ var startMarker = this._selectionHandles['start'];
+ var endMarker = this._selectionHandles['end'];
var startPos = this._map.project(this._textSelectionStart.getSouthWest());
var endPos = this._map.project(this._textSelectionEnd.getSouthWest());
More information about the Libreoffice-commits
mailing list