Restore toggleMathjax for legacy editor

This commit is contained in:
Abdo 2025-09-30 15:52:43 +03:00
parent 6bd560ea3a
commit fbd21ba7f1
4 changed files with 13 additions and 5 deletions

View file

@ -1377,7 +1377,7 @@ components and functionality for general note editing.
/>
{/if}
<EditorToolbar {size} {wrap} api={toolbar}>
<EditorToolbar {size} {wrap} {isLegacy} api={toolbar}>
<svelte:fragment slot="notetypeButtons">
{#if mode === "browser"}
<ButtonGroupItem>

View file

@ -64,6 +64,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import TemplateButtons from "./TemplateButtons.svelte";
import type { InlineButtonsAPI } from "./InlineButtons.svelte";
export let isLegacy = false;
export let size: number;
export let wrap: boolean;
@ -105,7 +106,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
</Item>
<Item id="settings">
<OptionsButtons api={optionsButtons} />
<OptionsButtons api={optionsButtons} {isLegacy} />
</Item>
<Item id="inlineFormatting">

View file

@ -17,7 +17,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import { shrinkImagesByDefault } from "../image-overlay/ImageOverlay.svelte";
import { closeHTMLTags } from "../plain-text-input/PlainTextInput.svelte";
import { setColConfig } from "@tslib/profile";
import { bridgeCommand } from "@tslib/bridgecommand";
export let isLegacy = false;
let showFloating = false;
function toggleShrinkImages(_evt: MouseEvent): void {
@ -28,8 +30,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
function toggleShowMathjax(_evt: MouseEvent): void {
mathjaxConfig.enabled = !mathjaxConfig.enabled;
setColConfig("renderMathjax", mathjaxConfig.enabled);
// FIXME: refresh
if (isLegacy) {
bridgeCommand("toggleMathjax");
} else {
setColConfig("renderMathjax", mathjaxConfig.enabled);
// FIXME: refresh
}
}
function toggleCloseHTMLTags(_evt: MouseEvent): void {

View file

@ -14,6 +14,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
import OptionsButton from "./OptionsButton.svelte";
export let api = {};
export let isLegacy = false;
</script>
<ButtonGroup>
@ -25,7 +26,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
{api}
>
<ButtonGroupItem id="options">
<OptionsButton />
<OptionsButton {isLegacy} />
</ButtonGroupItem>
</DynamicallySlottable>
</ButtonGroup>