mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-02-28 22:31:15 +01:00
kalk_web: Fill in value on touch
This commit is contained in:
parent
4fe8f8b77c
commit
e5f54df095
@ -61,4 +61,4 @@
|
||||
"browserslist": [
|
||||
"defaults"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
@ -144,6 +144,13 @@
|
||||
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) {
|
||||
const target = event.target as HTMLElement;
|
||||
target.blur();
|
||||
@ -321,11 +328,13 @@
|
||||
<section class="output" bind:this={outputElement}>
|
||||
<slot />
|
||||
{#each outputLines as line}
|
||||
<console-line byuser={line[1]}>
|
||||
<console-line byuser={line[1]} on:touchstart={handleTouchLine}>
|
||||
{#if line[1]}
|
||||
<span style="color: {promptcolor}">>></span>
|
||||
{/if}
|
||||
{@html line[0]}
|
||||
<span class="value">
|
||||
{@html line[0]}
|
||||
</span>
|
||||
</console-line>
|
||||
{/each}
|
||||
</section>
|
||||
|
Loading…
Reference in New Issue
Block a user