diff --git a/src/App.svelte b/src/App.svelte index f00aa75..729aae4 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -24,7 +24,7 @@ function get_idx_by_id(id) { for(let idx = 0; idx < cards.length; idx++) { if(id === cards[idx].id) { - return idx + return idx; } } } @@ -60,9 +60,9 @@ if (cards.length > 1) { // remove only if there is more than 1 card cards = cards.filter(x => x.id != selector); if (selected_idx >= cards.length) { - selector = cards[cards.length-1].id; + selector = cards[cards.length-1].id; } else { - selector = cards[selected_idx].id; + selector = cards[selected_idx].id; } } } diff --git a/src/CardInput.svelte b/src/CardInput.svelte index 89a41ee..f9f0887 100644 --- a/src/CardInput.svelte +++ b/src/CardInput.svelte @@ -17,10 +17,10 @@ input.setAttribute('accept', 'image/*'); input.onchange = function () { - var file = this.files[0]; + var file = this.files[0]; - var reader = new FileReader(); - reader.onload = function () { + var reader = new FileReader(); + reader.onload = function () { /* Note: Now we need to register the blob in TinyMCEs image blob registry. In the next release this part hopefully won't be @@ -34,8 +34,8 @@ /* call the callback and populate the Title field with the file name */ cb(blobInfo.blobUri(), { title: file.name }); - }; - reader.readAsDataURL(file); + }; + reader.readAsDataURL(file); }; input.click();