improving markdown editor
This commit is contained in:
@@ -106,13 +106,15 @@
|
||||
|
||||
<div class="markdown {editing?'editing':''}">
|
||||
{#if editing}
|
||||
<span class="hint">{@html t('markdown_supported')}</span>
|
||||
<textarea bind:value={editValue.source} onkeyup={typed} autofocus={!simple}></textarea>
|
||||
<div>{@html target(editValue.rendered)}</div>
|
||||
<div class="preview">{@html target(editValue.rendered)}</div>
|
||||
{#if !simple}
|
||||
<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>
|
||||
{/if}
|
||||
{:else}
|
||||
<svelte:element this={type} {onclick} {oncontextmenu} class={{editable}} title={t('right_click_to_edit')} >{@html target(editValue.rendered)}</svelte:element>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user