Use 'image' as key for a new image if it is available
This commit is contained in:
parent
6ce60a79b2
commit
1ed9467221
1 changed files with 11 additions and 5 deletions
|
@ -48,12 +48,18 @@ export class OsmImageUploadHandler {
|
||||||
title: title,
|
title: title,
|
||||||
description: description,
|
description: description,
|
||||||
handleURL: function (url) {
|
handleURL: function (url) {
|
||||||
|
|
||||||
|
let key = "image";
|
||||||
|
if (tags["image"] !== undefined) {
|
||||||
|
|
||||||
let freeIndex = 0;
|
let freeIndex = 0;
|
||||||
while (tags["image:" + freeIndex] !== undefined) {
|
while (tags["image:" + freeIndex] !== undefined) {
|
||||||
freeIndex++;
|
freeIndex++;
|
||||||
}
|
}
|
||||||
console.log("Adding image:" + freeIndex, url);
|
key = "image:" + freeIndex;
|
||||||
changes.addChange(tags.id, "image:" + freeIndex, url);
|
}
|
||||||
|
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
|
self._slideShow.MoveTo(-1); // set the last (thus newly added) image) to view
|
||||||
},
|
},
|
||||||
allDone: function () {
|
allDone: function () {
|
||||||
|
|
Loading…
Reference in a new issue