mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
Fix MathJax popup fails to appear when adding MathJax via Fx button
This commit is contained in:
parent
968a14784f
commit
11115f59bc
1 changed files with 9 additions and 1 deletions
|
@ -6,6 +6,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import * as tr from "@tslib/ftl";
|
import * as tr from "@tslib/ftl";
|
||||||
import { getPlatformString } from "@tslib/shortcuts";
|
import { getPlatformString } from "@tslib/shortcuts";
|
||||||
import { wrapInternal } from "@tslib/wrap";
|
import { wrapInternal } from "@tslib/wrap";
|
||||||
|
import { tick } from "svelte";
|
||||||
|
|
||||||
import DropdownItem from "../../components/DropdownItem.svelte";
|
import DropdownItem from "../../components/DropdownItem.svelte";
|
||||||
import IconButton from "../../components/IconButton.svelte";
|
import IconButton from "../../components/IconButton.svelte";
|
||||||
|
@ -76,6 +77,13 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
$: disabled = !$focusedInput || !editingInputIsRichText($focusedInput);
|
$: disabled = !$focusedInput || !editingInputIsRichText($focusedInput);
|
||||||
|
|
||||||
let showFloating = false;
|
let showFloating = false;
|
||||||
|
let onHidden: (() => void) | null = null;
|
||||||
|
$: if (!showFloating) {
|
||||||
|
tick().then(() => {
|
||||||
|
onHidden?.();
|
||||||
|
onHidden = null;
|
||||||
|
});
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<WithFloating
|
<WithFloating
|
||||||
|
@ -94,7 +102,7 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
<Popover slot="floating" --popover-padding-inline="0">
|
<Popover slot="floating" --popover-padding-inline="0">
|
||||||
{#each dropdownItems as [callback, keyCombination, label]}
|
{#each dropdownItems as [callback, keyCombination, label]}
|
||||||
<DropdownItem on:click={callback}>
|
<DropdownItem on:click={() => (onHidden = callback)}>
|
||||||
<span>{label}</span>
|
<span>{label}</span>
|
||||||
<span class="ms-auto ps-2 shortcut"
|
<span class="ms-auto ps-2 shortcut"
|
||||||
>{getPlatformString(keyCombination)}</span
|
>{getPlatformString(keyCombination)}</span
|
||||||
|
|
Loading…
Reference in a new issue