From fc8a047f2f99c3394e4119f5523408149545cedd Mon Sep 17 00:00:00 2001 From: Borja Robert Date: Tue, 27 Sep 2022 01:35:17 +0200 Subject: [PATCH] resuelve cosillas de jsdoc --- src/lib/form/Form.svelte | 13 +++---------- src/lib/form/Organized.svelte | 13 ++++++++----- src/lib/preview/Preview.svelte | 10 +++++----- 3 files changed, 16 insertions(+), 20 deletions(-) diff --git a/src/lib/form/Form.svelte b/src/lib/form/Form.svelte index e2d32ee..f619e73 100644 --- a/src/lib/form/Form.svelte +++ b/src/lib/form/Form.svelte @@ -26,7 +26,9 @@ console.log('no hay editor'); return; } - $content = editor.firstChild.innerHTML; + if (editor && editor.firstChild !== null) { + $content = editor.firstChild.innerHTML; + } }; const downloadCanvas = async () => { @@ -134,13 +136,4 @@ font-size: 1.1rem; cursor: pointer; } - - .upload { - max-width: 48px; - cursor: pointer; - } - - .chan { - cursor: pointer; - } diff --git a/src/lib/form/Organized.svelte b/src/lib/form/Organized.svelte index dd6bae6..683c77e 100644 --- a/src/lib/form/Organized.svelte +++ b/src/lib/form/Organized.svelte @@ -11,9 +11,9 @@ canvas } from '$lib/stores/store'; - let fileinput, avatar; + /** @type {HTMLInputElement} */ let fileinput; - const onFileSelected = (e) => { + const onFileSelected = (/** @type {Event} */ e) => { let image = e.target.files[0]; let reader = new FileReader(); reader.readAsDataURL(image); @@ -22,7 +22,7 @@ }; }; - const removeOrganizer = (index) => { + const removeOrganizer = (/** @type {number} */ index) => { if (index > -1) { $organizedBy.splice(index, 1); $organizedBy = $organizedBy; @@ -89,10 +89,13 @@ .remove { position: absolute; - top: 0px; - right: 0.25rem; + top: -4px; + right: -0.25rem; color: red; cursor: pointer; + background-color: white; + padding: 0 0.25rem; + /* box-shadow: 0 0 4px 0 rgba(0, 0, 0, 0.5); */ } input { display: block; diff --git a/src/lib/preview/Preview.svelte b/src/lib/preview/Preview.svelte index 211f654..6dd5c4f 100644 --- a/src/lib/preview/Preview.svelte +++ b/src/lib/preview/Preview.svelte @@ -11,9 +11,9 @@ canvas } from '$lib/stores/store'; - let newdate = ''; + /** @type {Object} */ let newdate = {}; - const convertDateTime = (datetime) => { + const convertDateTime = (/** @type {string | undefined} */ datetime) => { if (datetime == undefined) { return { date: '', @@ -41,15 +41,15 @@
{$title}
{$subtitle}
{@html $content}
- {#if newdate}
{newdate.date}
{/if} - {#if newdate}
{newdate.time}
{/if} + {#if newdate.date}
{newdate.date}
{/if} + {#if newdate.time}
{newdate.time}
{/if}
{$address}
{#if $organizedBy[0]}
Organiza:
{#each $organizedBy as organization, i}
- + {organization.text}
{organization.text}
{/each}