Anki/ts/editor/rich-text-input
Arthur Milchior efaaae8ce4
Cloze button get disabled outside of cloze field (#3879)
* NF: replace `disabled` by `enabled`

This allows to remove the negations and, in my opinion, make the code
easier to understand and edit.

* Cloze button get disabled outside of cloze field

More specifically, if the user focus in a field that is not a cloze
field, the button are still there but appear as disabled. The shortcut
instead of adding the cloze context shows an alert explaining why this
can't be done.

While this message is already displayed when the user tries to add a
note with cloze in non-cloze field, I suspect it will save time to
stop the user as soon as possible from making mistake. This should
make very clear what is authorized and what is not.

It'll also be a reminder of whether the current field is a cloze or
not.

In order to do this, I added a back-end method (that I expect we may
reuse in ankidroid) to get the index of the fields used in cloze. This
set is sent to the note editor, which propagates it where needed.

In mathjax, the cloze symbol is removed when the selected field is not
a cloze field.
2025-04-24 18:37:41 +10:00
..
CustomStyles.svelte Update to Svelte 4, and update most other JS deps (#2565) 2023-07-01 16:21:53 +10:00
index.ts Refactor how toolbar buttons get to surround within editor fields (#1931) 2022-08-15 13:34:16 +10:00
normalizing-node-store.ts Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
rich-text-resolve.ts Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
RichTextInput.svelte Cloze button get disabled outside of cloze field (#3879) 2025-04-24 18:37:41 +10:00
RichTextStyles.svelte Reduce use of type casting (#3723) 2025-01-12 20:05:05 +11:00
StyleLink.svelte Update to Svelte 4, and update most other JS deps (#2565) 2023-07-01 16:21:53 +10:00
StyleTag.svelte Update to Svelte 4, and update most other JS deps (#2565) 2023-07-01 16:21:53 +10:00
transform.ts Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00