implemented updating of projects
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script>
|
||||
import { activeField } from './field_sync.svelte.js';
|
||||
import { t } from '../translations.svelte.js';
|
||||
|
||||
let { editable = false, value = $bindable(null), onSet = (newVal) => {} } = $props();
|
||||
let editing = $state(false);
|
||||
@@ -28,6 +29,7 @@
|
||||
if (ev.keyCode == 13 && ev.ctrlKey) applyEdit();
|
||||
if (ev.keyCode == 27) resetEdit();
|
||||
}
|
||||
console.log(value);
|
||||
|
||||
activeField.subscribe((val) => resetEdit());
|
||||
</script>
|
||||
@@ -49,9 +51,11 @@
|
||||
{#if editable && editing}
|
||||
<textarea bind:value={editValue} onkeyup={typed} autofocus></textarea>
|
||||
{:else}
|
||||
<div onclick={startEdit} class={{editable}}>
|
||||
{#each value.split("\n") as line}
|
||||
{line}<br/>
|
||||
{/each}
|
||||
</div>
|
||||
{#if value}
|
||||
<div ondblclick={startEdit} class={{editable}} title={t('double_click_to_edit')} >
|
||||
{#each value.split("\n") as line}
|
||||
{line}<br/>
|
||||
{/each}
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
Reference in New Issue
Block a user