mirror of
https://github.com/PaddiM8/kalker.git
synced 2024-12-13 01:50:41 +01:00
kalk_web: Added placeholder
This commit is contained in:
parent
5401415bba
commit
ddd075ef64
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@paddim8/kalk-component",
|
||||
"version": "1.2.0",
|
||||
"version": "1.2.1",
|
||||
"description": "A Svelte component for kalk, a calculator that supports user-defined functions and variables.",
|
||||
"svelte": "src/main.ts",
|
||||
"main": "public/build/bundle.js",
|
||||
|
@ -56,6 +56,10 @@
|
||||
function setHtml(html: string) {
|
||||
highlightedTextElement.innerHTML = html;
|
||||
inputElement.value = highlightedTextElement.textContent;
|
||||
|
||||
if (!html) {
|
||||
highlightedTextElement.innerHTML = `<span class='placeholder'>${hinttext}</div>`;
|
||||
}
|
||||
}
|
||||
|
||||
function getHtml(): string {
|
||||
@ -310,7 +314,9 @@
|
||||
class="highlighted-text"
|
||||
aria-hidden
|
||||
bind:this={highlightedTextElement}
|
||||
/>
|
||||
>
|
||||
<span class="placeholder">{hinttext}</span>
|
||||
</div>
|
||||
<textarea
|
||||
class="input"
|
||||
placeholder={hinttext}
|
||||
@ -388,6 +394,10 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
color: gray;
|
||||
}
|
||||
|
||||
.prompt {
|
||||
background-color: inherit;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user