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 freeIndex = 0;
|
|
||||||
while (tags["image:" + freeIndex] !== undefined) {
|
let key = "image";
|
||||||
freeIndex++;
|
if (tags["image"] !== undefined) {
|
||||||
|
|
||||||
|
let freeIndex = 0;
|
||||||
|
while (tags["image:" + freeIndex] !== undefined) {
|
||||||
|
freeIndex++;
|
||||||
|
}
|
||||||
|
key = "image:" + freeIndex;
|
||||||
}
|
}
|
||||||
console.log("Adding image:" + freeIndex, url);
|
console.log("Adding image:" + key, url);
|
||||||
changes.addChange(tags.id, "image:" + freeIndex, 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