Fix cloze buttons not working in MathJax editor

Regressed in #2144
This commit is contained in:
Damien Elmes 2023-01-05 15:58:32 +10:00
parent 037610715d
commit f9aa232d9b
2 changed files with 5 additions and 2 deletions

View file

@ -16,6 +16,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { context as noteEditorContext } from "./NoteEditor.svelte"; import { context as noteEditorContext } from "./NoteEditor.svelte";
import { editingInputIsRichText } from "./rich-text-input"; import { editingInputIsRichText } from "./rich-text-input";
export let alwaysEnabled = false;
const { focusedInput, fields } = noteEditorContext.get(); const { focusedInput, fields } = noteEditorContext.get();
// Workaround for Cmd+Option+Shift+C not working on macOS. The keyup approach works // Workaround for Cmd+Option+Shift+C not working on macOS. The keyup approach works
@ -67,7 +69,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
}); });
} }
$: disabled = !$focusedInput || !editingInputIsRichText($focusedInput); $: disabled =
!alwaysEnabled && (!$focusedInput || !editingInputIsRichText($focusedInput));
const incrementKeyCombination = "Control+Shift+C"; const incrementKeyCombination = "Control+Shift+C";
const sameKeyCombination = "Control+Alt+Shift+C"; const sameKeyCombination = "Control+Alt+Shift+C";

View file

@ -38,7 +38,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</IconButton> </IconButton>
</ButtonGroup> </ButtonGroup>
<ClozeButtons on:surround /> <ClozeButtons on:surround alwaysEnabled={true} />
<ButtonGroup> <ButtonGroup>
<IconButton <IconButton