mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 20:57:13 -05:00
Add warning box
This commit is contained in:
parent
f7b857887d
commit
d8fcc44fe5
1 changed files with 8 additions and 3 deletions
|
|
@ -5,6 +5,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { tick } from "svelte";
|
import { tick } from "svelte";
|
||||||
import * as tr from "@generated/ftl";
|
import * as tr from "@generated/ftl";
|
||||||
|
import Warning from "./Warning.svelte";
|
||||||
|
|
||||||
export let value: number[];
|
export let value: number[];
|
||||||
|
|
||||||
|
|
@ -50,10 +51,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
let clickCount = 0;
|
let clickCount = 0;
|
||||||
function onClick() {
|
function onClick() {
|
||||||
clickCount += 1;
|
clickCount += 1;
|
||||||
if (clickCount == UNLOCK_EDIT_COUNT) {
|
|
||||||
alert(tr.deckConfigManualParameterEditWarning());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: unlockEditWarning =
|
||||||
|
clickCount >= UNLOCK_EDIT_COUNT
|
||||||
|
? tr.deckConfigManualParameterEditWarning()
|
||||||
|
: "";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window onresize={updateHeight} />
|
<svelte:window onresize={updateHeight} />
|
||||||
|
|
@ -71,6 +74,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<Warning warning={unlockEditWarning} className="alert-danger"></Warning>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
textarea {
|
textarea {
|
||||||
resize: none;
|
resize: none;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue