Merge branch 'main' into dev
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
href = '#',
|
||||
onclick = evt => { evt.preventDefault(); startEdit(); return false },
|
||||
onSet = newVal => {return true;},
|
||||
title = t('long_click_to_edit'),
|
||||
title = t('click_to_edit'),
|
||||
type = 'div',
|
||||
value = $bindable(null)
|
||||
} = $props();
|
||||
|
||||
@@ -104,29 +104,16 @@
|
||||
if (simple) startEdit();
|
||||
</script>
|
||||
|
||||
<style>
|
||||
textarea{
|
||||
width: 100%;
|
||||
min-height: 100px;
|
||||
}
|
||||
div{
|
||||
min-width: 40px;
|
||||
min-height: 20px;
|
||||
}
|
||||
div.editable:hover{
|
||||
border: 1px dotted;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="markdown {editing?'editing':''}">
|
||||
{#if editing}
|
||||
<div class="boundary">
|
||||
<textarea bind:value={editValue.source} onkeyup={typed} autofocus={!simple}></textarea>
|
||||
<span class="buttons">
|
||||
<button class="cancel" onclick={e => editing = false}>{t('cancel')}</button>
|
||||
<button class="save" onclick={doSave}>{t('save')}</button>
|
||||
</span>
|
||||
<textarea bind:value={editValue.source} onkeyup={typed} autofocus={!simple}></textarea>
|
||||
<div>{@html target(editValue.rendered)}</div>
|
||||
<div class="buttons">
|
||||
<button class="cancel" onclick={e => editing = false}>{t('cancel')}</button>
|
||||
<span>{@html t('markdown_supported')}</span>
|
||||
<button class="save" onclick={doSave}>{t('save')}</button>
|
||||
</div>
|
||||
{:else}
|
||||
<svelte:element this={type} {onclick} {oncontextmenu} class={{editable}} title={t('right_click_to_edit')} >{@html target(editValue.rendered)}</svelte:element>
|
||||
{/if}
|
||||
<svelte:element this={type} {onclick} {oncontextmenu} class={{editable}} title={t('long_click_to_edit')} >{@html target(editValue.rendered)}</svelte:element>
|
||||
</div>
|
||||
@@ -85,7 +85,7 @@
|
||||
<textarea bind:value={editValue} onkeyup={typed} autofocus></textarea>
|
||||
{:else}
|
||||
{#if value}
|
||||
<svelte:element this={type} {onmousedown} {onmouseup} {ontouchstart} {ontouchend} class={{editable}} title={t('long_click_to_edit')} >
|
||||
<svelte:element this={type} {onmousedown} {onmouseup} {ontouchstart} {ontouchend} class={{editable}} title={t('right_click_to_edit')} >
|
||||
{#each value.split("\n") as line}
|
||||
{line}<br/>
|
||||
{/each}
|
||||
|
||||
@@ -49,5 +49,4 @@
|
||||
</fieldset>
|
||||
</form>
|
||||
<Notes module="time" entity_id={record.id} />
|
||||
{record.description.source}
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user