mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
move div up slots instead of using condition
This commit is contained in:
parent
05da8ee361
commit
407f046c32
3 changed files with 22 additions and 26 deletions
|
@ -12,7 +12,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
export { className as class };
|
||||
|
||||
export let title: string;
|
||||
export let onHelpClick: ((_e: MouseEvent | KeyboardEvent) => void) | null = null;
|
||||
</script>
|
||||
|
||||
<div
|
||||
|
@ -28,18 +27,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
<h1>
|
||||
{title}
|
||||
</h1>
|
||||
{#if onHelpClick}
|
||||
<div
|
||||
on:click={onHelpClick}
|
||||
on:keydown={onHelpClick}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
class="help-badge position-absolute"
|
||||
class:rtl
|
||||
>
|
||||
<slot name="tooltip" />
|
||||
</div>
|
||||
{/if}
|
||||
<div class="help-badge position-absolute" class:rtl>
|
||||
<slot name="tooltip" />
|
||||
</div>
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
|
|
|
@ -8,7 +8,6 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
// When title is null (default), the graph is inlined, not having TitledContainer wrapper.
|
||||
export let title: string | null = null;
|
||||
export let subtitle: string | null = null;
|
||||
export let onHelpClick: ((_e: MouseEvent | KeyboardEvent) => void) | null = null;
|
||||
</script>
|
||||
|
||||
{#if title == null}
|
||||
|
@ -19,8 +18,8 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
<slot />
|
||||
</div>
|
||||
{:else}
|
||||
<TitledContainer class="d-flex flex-column" {title} {onHelpClick}>
|
||||
<slot slot="tooltip" name="tooltip"></slot>
|
||||
<TitledContainer class="d-flex flex-column" {title}>
|
||||
<slot name="tooltip" slot="tooltip"></slot>
|
||||
<div class="graph d-flex flex-grow-1 flex-column justify-content-center">
|
||||
{#if subtitle}
|
||||
<div class="subtitle">{subtitle}</div>
|
||||
|
|
|
@ -62,17 +62,24 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
};
|
||||
</script>
|
||||
|
||||
<Graph {title} {subtitle} {onHelpClick}>
|
||||
<HelpModal
|
||||
title={tr.statisticsTrueRetentionTitle()}
|
||||
url={HelpPage.DeckOptions.fsrs}
|
||||
<Graph {title} {subtitle}>
|
||||
<div
|
||||
slot="tooltip"
|
||||
{helpSections}
|
||||
on:mount={(e) => {
|
||||
modal = e.detail.modal;
|
||||
carousel = e.detail.carousel;
|
||||
}}
|
||||
/>
|
||||
onclick={onHelpClick}
|
||||
onkeydown={onHelpClick}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<HelpModal
|
||||
title={tr.statisticsTrueRetentionTitle()}
|
||||
url={HelpPage.DeckOptions.fsrs}
|
||||
{helpSections}
|
||||
on:mount={(e) => {
|
||||
modal = e.detail.modal;
|
||||
carousel = e.detail.carousel;
|
||||
}}
|
||||
/>
|
||||
</div>
|
||||
<InputBox>
|
||||
<label>
|
||||
<input type="radio" bind:group={mode} value={DisplayMode.Young} />
|
||||
|
|
Loading…
Reference in a new issue