diff --git a/ts/editable/mathjax-component.ts b/ts/editable/mathjax-component.ts index 088a679b8..5fecdf69a 100644 --- a/ts/editable/mathjax-component.ts +++ b/ts/editable/mathjax-component.ts @@ -130,8 +130,10 @@ export const Mathjax: DecoratedElementConstructor = class Mathjax case "block": this.block = newValue !== "false"; this.component?.$set({ block: this.block }); + break; case "data-mathjax": this.component?.$set({ mathjax: newValue }); + break; } } diff --git a/ts/editor/MathjaxHandle.svelte b/ts/editor/MathjaxHandle.svelte index b40c84350..391e52755 100644 --- a/ts/editor/MathjaxHandle.svelte +++ b/ts/editor/MathjaxHandle.svelte @@ -27,7 +27,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html resizeObserver.observe(container); let updateSelection: () => void; - let edit = false; function onUpdate(event: CustomEvent) { activeImage!.parentElement!.dataset.mathjax = event.detail.mathjax; @@ -51,37 +50,29 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html bind:updateSelection on:mount={(event) => createDropdown(event.detail.selection)} > - event.stopPropagation()} - on:dblclick={() => (edit = !edit)} - /> + event.stopPropagation()} /> - {#if !edit} - - { - onUpdate(event); - setTimeout(dropdownObject.update); - }} - /> - - {:else} - -
{ - updateSelection(); - dropdownObject.update(); - }} - > - - - -
-
- {/if} + + { + onUpdate(event); + setTimeout(dropdownObject.update); + }} + /> +
{ + updateSelection(); + dropdownObject.update(); + }} + > + + + +
+
{/if}