From 90a936b07f7ffffb7a83838dbf9ccb7daccd0f84 Mon Sep 17 00:00:00 2001 From: Stephan Richter Date: Tue, 29 Jul 2025 09:01:37 +0200 Subject: [PATCH] cleaning up javascript code --- frontend/src/Components/Autocomplete.svelte | 29 +++++++++-------- .../src/Components/CompanySelector.svelte | 22 +++++++------ .../src/Components/ContactSelector.svelte | 22 ++++++++----- frontend/src/Components/LineEditor.svelte | 15 +++++---- frontend/src/Components/Login.svelte | 20 ++++++------ frontend/src/Components/MarkdownEditor.svelte | 31 +++++++++---------- frontend/src/Components/MemberEditor.svelte | 23 ++++++++------ frontend/src/Components/Menu.svelte | 11 ++++--- .../src/Components/MultilineEditor.svelte | 18 +++++------ .../src/Components/PermissionSelector.svelte | 5 +-- frontend/src/Components/PriceEditor.svelte | 11 +++++-- frontend/src/Components/StateSelector.svelte | 17 +++++----- frontend/src/routes/document/Add.svelte | 28 ++++++++++------- 13 files changed, 138 insertions(+), 114 deletions(-) diff --git a/frontend/src/Components/Autocomplete.svelte b/frontend/src/Components/Autocomplete.svelte index 5f98d0e..2985edf 100644 --- a/frontend/src/Components/Autocomplete.svelte +++ b/frontend/src/Components/Autocomplete.svelte @@ -1,29 +1,29 @@ {#if companies} diff --git a/frontend/src/Components/ContactSelector.svelte b/frontend/src/Components/ContactSelector.svelte index 273461d..0a606ed 100644 --- a/frontend/src/Components/ContactSelector.svelte +++ b/frontend/src/Components/ContactSelector.svelte @@ -1,18 +1,25 @@ {#if contacts} diff --git a/frontend/src/Components/LineEditor.svelte b/frontend/src/Components/LineEditor.svelte index 6bf5d2e..247aa3b 100644 --- a/frontend/src/Components/LineEditor.svelte +++ b/frontend/src/Components/LineEditor.svelte @@ -4,15 +4,15 @@ let { editable = false, - onclick = evt => { startEdit() }, - onSet = newVal => {return true;}, - type = 'div', - value = $bindable(null) + onclick = evt => { startEdit() }, + onSet = newVal => {return true;}, + type = 'div', + value = $bindable(null) } = $props(); - let editing = $state(false); + let editing = $state(false); let editValue = value; - let start = 0; + let start = 0; async function applyEdit(){ let success = await onSet(editValue); @@ -21,7 +21,7 @@ } function resetEdit(){ - editing = false; + editing = false; editValue = value; } @@ -63,7 +63,6 @@ measured(evt, evt.timeStamp - start); } - activeField.subscribe((val) => resetEdit()); diff --git a/frontend/src/Components/Login.svelte b/frontend/src/Components/Login.svelte index 9850401..00830f6 100644 --- a/frontend/src/Components/Login.svelte +++ b/frontend/src/Components/Login.svelte @@ -1,12 +1,14 @@ {#if error} diff --git a/frontend/src/Components/Menu.svelte b/frontend/src/Components/Menu.svelte index 9e84a0e..a0fd633 100644 --- a/frontend/src/Components/Menu.svelte +++ b/frontend/src/Components/Menu.svelte @@ -1,15 +1,16 @@