Refactoring: port add-image-to-note to new element as well, remove obsolete classes, fix note creation

This commit is contained in:
Pieter Vander Vennet 2023-09-25 02:55:43 +02:00
parent 94ba18785d
commit 9a5a2e9924
10 changed files with 617 additions and 1001 deletions

View file

@ -16,6 +16,10 @@ import Svg from "../../Svg";
export let state: SpecialVisualizationState;
export let tags: Store<OsmTags>;
/**
* Image to show in the button
* NOT the image to upload!
*/
export let image: string = undefined;
if (image === "") {
image = undefined;
@ -30,7 +34,7 @@ function handleFiles(files: FileList) {
const file = files.item(i);
console.log("Got file", file.name)
try {
state.imageUploadManager.uploadImageAndApply(file, tags.data);
state.imageUploadManager.uploadImageAndApply(file, tags);
} catch (e) {
alert(e);
}