mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
make 'for' argument optional in TooltipLabel
The latest svelte-check has revealed we were not passing 'for' in when we should have been. This is a quick hack to get the tests passing again, but a better approach that actually makes this accessible again would be good in the future.
This commit is contained in:
parent
04ba24cb54
commit
d44b49294b
2 changed files with 7 additions and 4 deletions
|
@ -5,7 +5,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Row from "./Row.svelte";
|
import Row from "./Row.svelte";
|
||||||
import Col from "./Col.svelte";
|
import Col from "./Col.svelte";
|
||||||
import Label from "./Label.svelte";
|
|
||||||
import TooltipLabel from "./TooltipLabel.svelte";
|
import TooltipLabel from "./TooltipLabel.svelte";
|
||||||
import CheckBox from "./CheckBox.svelte";
|
import CheckBox from "./CheckBox.svelte";
|
||||||
import RevertButton from "./RevertButton.svelte";
|
import RevertButton from "./RevertButton.svelte";
|
||||||
|
@ -20,7 +19,7 @@
|
||||||
<RevertButton bind:value {defaultValue} />
|
<RevertButton bind:value {defaultValue} />
|
||||||
<CheckBox bind:value
|
<CheckBox bind:value
|
||||||
>{#if markdownTooltip}<TooltipLabel {markdownTooltip}><slot /></TooltipLabel
|
>{#if markdownTooltip}<TooltipLabel {markdownTooltip}><slot /></TooltipLabel
|
||||||
>{:else}<Label><slot /></Label>{/if}</CheckBox
|
>{:else}<slot />{/if}</CheckBox
|
||||||
>
|
>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
|
@ -10,12 +10,16 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
import Badge from "components/Badge.svelte";
|
import Badge from "components/Badge.svelte";
|
||||||
|
|
||||||
export let markdownTooltip: string;
|
export let markdownTooltip: string;
|
||||||
let forId: string;
|
let forId: string | undefined = undefined;
|
||||||
export { forId as for };
|
export { forId as for };
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
|
{#if forId}
|
||||||
<Label for={forId}><slot /></Label>
|
<Label for={forId}><slot /></Label>
|
||||||
|
{:else}
|
||||||
|
<slot />
|
||||||
|
{/if}
|
||||||
<WithTooltip
|
<WithTooltip
|
||||||
tooltip={marked(markdownTooltip)}
|
tooltip={marked(markdownTooltip)}
|
||||||
showDelay={250}
|
showDelay={250}
|
||||||
|
|
Loading…
Reference in a new issue