trying to improve editing on long-tap
Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
@@ -44,6 +44,12 @@
|
||||
}
|
||||
}
|
||||
|
||||
function oncontextmenu(evt){
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
|
||||
function onmousedown(evt){
|
||||
evt.preventDefault();
|
||||
start = evt.timeStamp;
|
||||
@@ -85,5 +91,5 @@
|
||||
{#if editable && editing}
|
||||
<input bind:value={editValue} onkeyup={typed} autofocus />
|
||||
{:else}
|
||||
<svelte:element this={type} href="#" {onclick} {onmousedown} {onmouseup} {ontouchstart} {ontouchend} class={{editable}} title={t('long_click_to_edit')} >{value}</svelte:element>
|
||||
<svelte:element this={type} href="#" {onclick} {onmousedown} {onmouseup} {ontouchstart} {ontouchend} {oncontextmenu} class={{editable}} title={t('long_click_to_edit')} >{value}</svelte:element>
|
||||
{/if}
|
||||
|
||||
@@ -70,6 +70,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function oncontextmenu(evt){
|
||||
evt.preventDefault();
|
||||
evt.stopPropagation();
|
||||
return false;
|
||||
}
|
||||
|
||||
function onmousedown(evt){
|
||||
evt.preventDefault();
|
||||
start = evt.timeStamp;
|
||||
@@ -108,7 +115,9 @@
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="markdown {editing?'editing':''}">
|
||||
{#if editing}
|
||||
<textarea bind:value={editValue.source} onkeyup={typed} autofocus={!simple}></textarea>
|
||||
{/if}
|
||||
<svelte:element this={type} {onmousedown} {onmouseup} {ontouchstart} {ontouchend} class={{editable}} title={t('long_click_to_edit')} >{@html editValue.rendered}</svelte:element>
|
||||
<svelte:element this={type} {onmousedown} {onmouseup} {ontouchstart} {ontouchend} {oncontextmenu} class={{editable}} title={t('long_click_to_edit')} >{@html editValue.rendered}</svelte:element>
|
||||
</div>
|
||||
Reference in New Issue
Block a user