diff --git a/loleaflet/src/layer/tile/CanvasTileLayer.js b/loleaflet/src/layer/tile/CanvasTileLayer.js index 51d2b9216..68630ba2a 100644 --- a/loleaflet/src/layer/tile/CanvasTileLayer.js +++ b/loleaflet/src/layer/tile/CanvasTileLayer.js @@ -5309,10 +5309,18 @@ L.CanvasTileLayer = L.Layer.extend({ // Used with filebasedview. _getMostVisiblePart: function (queue) { var parts = []; + var found = false; for (var i = 0; i < queue.length; i++) { - if (parts.indexOf(queue[i].part) < 0) + for (var j = 0; j < parts.length; j++) { + if (parts[j].part === queue[i].part) { + found = true; + break; + } + } + if (!found) parts.push({part: queue[i].part, tileCount: 0}); + found = false; } var maxTileCount = 0; @@ -5439,7 +5447,6 @@ L.CanvasTileLayer = L.Layer.extend({ } } - for (var i = 0; i < this._tiles.length; i++) { this._tiles[i].current = false; // Visible ones's "current" property will be set to true below. } diff --git a/loleaflet/src/layer/tile/CommentSection.ts b/loleaflet/src/layer/tile/CommentSection.ts index 28dfe742c..a76611c62 100644 --- a/loleaflet/src/layer/tile/CommentSection.ts +++ b/loleaflet/src/layer/tile/CommentSection.ts @@ -644,7 +644,7 @@ class Comment { if (this.sectionProperties.contentText.origText !== this.sectionProperties.nodeModifyText.value) { this.onSaveComment(e); } - else if (this.sectionProperties.nodeModifyText.value === '') { + else { this.onCancelClick(e); } }