mirror of
https://github.com/ankitects/anki.git
synced 2025-11-07 05:07:10 -05:00
Restore toggleMathjax for legacy editor
This commit is contained in:
parent
6bd560ea3a
commit
fbd21ba7f1
4 changed files with 13 additions and 5 deletions
|
|
@ -1377,7 +1377,7 @@ components and functionality for general note editing.
|
||||||
/>
|
/>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
<EditorToolbar {size} {wrap} api={toolbar}>
|
<EditorToolbar {size} {wrap} {isLegacy} api={toolbar}>
|
||||||
<svelte:fragment slot="notetypeButtons">
|
<svelte:fragment slot="notetypeButtons">
|
||||||
{#if mode === "browser"}
|
{#if mode === "browser"}
|
||||||
<ButtonGroupItem>
|
<ButtonGroupItem>
|
||||||
|
|
|
||||||
|
|
@ -64,6 +64,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import TemplateButtons from "./TemplateButtons.svelte";
|
import TemplateButtons from "./TemplateButtons.svelte";
|
||||||
import type { InlineButtonsAPI } from "./InlineButtons.svelte";
|
import type { InlineButtonsAPI } from "./InlineButtons.svelte";
|
||||||
|
|
||||||
|
export let isLegacy = false;
|
||||||
export let size: number;
|
export let size: number;
|
||||||
export let wrap: boolean;
|
export let wrap: boolean;
|
||||||
|
|
||||||
|
|
@ -105,7 +106,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
</Item>
|
</Item>
|
||||||
|
|
||||||
<Item id="settings">
|
<Item id="settings">
|
||||||
<OptionsButtons api={optionsButtons} />
|
<OptionsButtons api={optionsButtons} {isLegacy} />
|
||||||
</Item>
|
</Item>
|
||||||
|
|
||||||
<Item id="inlineFormatting">
|
<Item id="inlineFormatting">
|
||||||
|
|
|
||||||
|
|
@ -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 { shrinkImagesByDefault } from "../image-overlay/ImageOverlay.svelte";
|
||||||
import { closeHTMLTags } from "../plain-text-input/PlainTextInput.svelte";
|
import { closeHTMLTags } from "../plain-text-input/PlainTextInput.svelte";
|
||||||
import { setColConfig } from "@tslib/profile";
|
import { setColConfig } from "@tslib/profile";
|
||||||
|
import { bridgeCommand } from "@tslib/bridgecommand";
|
||||||
|
|
||||||
|
export let isLegacy = false;
|
||||||
let showFloating = false;
|
let showFloating = false;
|
||||||
|
|
||||||
function toggleShrinkImages(_evt: MouseEvent): void {
|
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 {
|
function toggleShowMathjax(_evt: MouseEvent): void {
|
||||||
mathjaxConfig.enabled = !mathjaxConfig.enabled;
|
mathjaxConfig.enabled = !mathjaxConfig.enabled;
|
||||||
setColConfig("renderMathjax", mathjaxConfig.enabled);
|
if (isLegacy) {
|
||||||
// FIXME: refresh
|
bridgeCommand("toggleMathjax");
|
||||||
|
} else {
|
||||||
|
setColConfig("renderMathjax", mathjaxConfig.enabled);
|
||||||
|
// FIXME: refresh
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleCloseHTMLTags(_evt: MouseEvent): void {
|
function toggleCloseHTMLTags(_evt: MouseEvent): void {
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import OptionsButton from "./OptionsButton.svelte";
|
import OptionsButton from "./OptionsButton.svelte";
|
||||||
|
|
||||||
export let api = {};
|
export let api = {};
|
||||||
|
export let isLegacy = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ButtonGroup>
|
<ButtonGroup>
|
||||||
|
|
@ -25,7 +26,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
{api}
|
{api}
|
||||||
>
|
>
|
||||||
<ButtonGroupItem id="options">
|
<ButtonGroupItem id="options">
|
||||||
<OptionsButton />
|
<OptionsButton {isLegacy} />
|
||||||
</ButtonGroupItem>
|
</ButtonGroupItem>
|
||||||
</DynamicallySlottable>
|
</DynamicallySlottable>
|
||||||
</ButtonGroup>
|
</ButtonGroup>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue