mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-06-23 19:21:26 +02:00
kalk_web: Fill in value on touch
This commit is contained in:
parent
561bd61c3f
commit
5b1589f687
@ -61,4 +61,4 @@
|
|||||||
"browserslist": [
|
"browserslist": [
|
||||||
"defaults"
|
"defaults"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -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…
x
Reference in New Issue
Block a user