mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-03-01 06:41:15 +01:00
kalk_web: Fill in value on touch
This commit is contained in:
parent
4fe8f8b77c
commit
e5f54df095
@ -144,6 +144,13 @@
|
|||||||
setCursorPos(target, cursorPos - offset);
|
setCursorPos(target, cursorPos - offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function handleTouchLine(event: Event) {
|
||||||
|
if (!inputElement.innerHTML) {
|
||||||
|
const target = event.currentTarget as HTMLElement;
|
||||||
|
inputElement.innerHTML = target.querySelector(".value").innerHTML;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handleButtonClick(event: Event) {
|
function handleButtonClick(event: Event) {
|
||||||
const target = event.target as HTMLElement;
|
const target = event.target as HTMLElement;
|
||||||
target.blur();
|
target.blur();
|
||||||
@ -321,11 +328,13 @@
|
|||||||
<section class="output" bind:this={outputElement}>
|
<section class="output" bind:this={outputElement}>
|
||||||
<slot />
|
<slot />
|
||||||
{#each outputLines as line}
|
{#each outputLines as line}
|
||||||
<console-line byuser={line[1]}>
|
<console-line byuser={line[1]} on:touchstart={handleTouchLine}>
|
||||||
{#if line[1]}
|
{#if line[1]}
|
||||||
<span style="color: {promptcolor}">>></span>
|
<span style="color: {promptcolor}">>></span>
|
||||||
{/if}
|
{/if}
|
||||||
{@html line[0]}
|
<span class="value">
|
||||||
|
{@html line[0]}
|
||||||
|
</span>
|
||||||
</console-line>
|
</console-line>
|
||||||
{/each}
|
{/each}
|
||||||
</section>
|
</section>
|
||||||
|
Loading…
Reference in New Issue
Block a user