Use 'image' as key for a new image if it is available

This commit is contained in:
Pieter Vander Vennet 2020-07-21 22:40:46 +02:00
parent 6ce60a79b2
commit 1ed9467221

View file

@ -48,12 +48,18 @@ export class OsmImageUploadHandler {
title: title,
description: description,
handleURL: function (url) {
let key = "image";
if (tags["image"] !== undefined) {
let freeIndex = 0;
while (tags["image:" + freeIndex] !== undefined) {
freeIndex++;
}
console.log("Adding image:" + freeIndex, url);
changes.addChange(tags.id, "image:" + freeIndex, url);
key = "image:" + freeIndex;
}
console.log("Adding image:" + key, url);
changes.addChange(tags.id, key, url);
self._slideShow.MoveTo(-1); // set the last (thus newly added) image) to view
},
allDone: function () {