mirror of
https://github.com/ankitects/anki.git
synced 2025-11-06 20:57:13 -05:00
a11y
This commit is contained in:
parent
b6ce0c6ae0
commit
c84441611d
1 changed files with 13 additions and 9 deletions
|
|
@ -60,29 +60,33 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
clickTimeout = setTimeout(() => {
|
clickTimeout = setTimeout(() => {
|
||||||
clickCount = 0;
|
clickCount = 0;
|
||||||
}, UNLOCK_CLICK_TIMEOUT_MS);
|
}, UNLOCK_CLICK_TIMEOUT_MS);
|
||||||
|
} else {
|
||||||
|
taRef.focus();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$: unlockEditWarning =
|
$: unlocked = clickCount >= UNLOCK_EDIT_COUNT;
|
||||||
clickCount >= UNLOCK_EDIT_COUNT
|
$: unlockEditWarning = unlocked ? tr.deckConfigManualParameterEditWarning() : "";
|
||||||
? tr.deckConfigManualParameterEditWarning()
|
|
||||||
: "";
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<svelte:window onresize={updateHeight} />
|
<svelte:window onresize={updateHeight} />
|
||||||
|
|
||||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
<span
|
||||||
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
on:click={onClick}
|
||||||
<div on:click={onClick}>
|
on:keypress={onClick}
|
||||||
|
role="button"
|
||||||
|
aria-label={"FSRS Parameters"}
|
||||||
|
tabindex={unlocked ? -1 : 0}
|
||||||
|
>
|
||||||
<textarea
|
<textarea
|
||||||
bind:this={taRef}
|
bind:this={taRef}
|
||||||
value={stringValue}
|
value={stringValue}
|
||||||
on:blur={update}
|
on:blur={update}
|
||||||
class="w-100"
|
class="w-100"
|
||||||
placeholder={tr.deckConfigPlaceholderParameters()}
|
placeholder={tr.deckConfigPlaceholderParameters()}
|
||||||
disabled={clickCount < UNLOCK_EDIT_COUNT}
|
disabled={!unlocked}
|
||||||
></textarea>
|
></textarea>
|
||||||
</div>
|
</span>
|
||||||
|
|
||||||
<Warning warning={unlockEditWarning} className="alert-danger"></Warning>
|
<Warning warning={unlockEditWarning} className="alert-danger"></Warning>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue