mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
* Reapply "Fix/Retention help button bounds (#4253)" (#4258)
This reverts commit fb2e2bd37a
.
* move div up slots instead of using condition
* Avoid tabbing
---------
Co-authored-by: Abdo <abdo@abdnh.net>
Co-authored-by: Damien Elmes <dae@users.noreply.github.com>
This commit is contained in:
parent
e676e1a484
commit
562cef1f22
3 changed files with 23 additions and 31 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 onTitleClick: ((_e: MouseEvent | KeyboardEvent) => void) | null = null;
|
||||
</script>
|
||||
|
||||
<div
|
||||
|
@ -25,22 +24,9 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
style:--container-margin="0"
|
||||
>
|
||||
<div class="position-relative">
|
||||
{#if onTitleClick}
|
||||
<span
|
||||
on:click={onTitleClick}
|
||||
on:keydown={onTitleClick}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
>
|
||||
<h1>
|
||||
{title}
|
||||
</h1>
|
||||
</span>
|
||||
{:else}
|
||||
<h1>
|
||||
{title}
|
||||
</h1>
|
||||
{/if}
|
||||
<h1>
|
||||
{title}
|
||||
</h1>
|
||||
<div class="help-badge position-absolute" class:rtl>
|
||||
<slot name="tooltip" />
|
||||
</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 onTitleClick: ((_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} {onTitleClick}>
|
||||
<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>
|
||||
|
|
|
@ -57,22 +57,29 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
const title = tr.statisticsTrueRetentionTitle();
|
||||
const subtitle = tr.statisticsTrueRetentionSubtitle();
|
||||
const onTitleClick = () => {
|
||||
const onHelpClick = () => {
|
||||
openHelpModal(Object.keys(retentionHelp).indexOf("trueRetention"));
|
||||
};
|
||||
</script>
|
||||
|
||||
<Graph {title} {subtitle} {onTitleClick}>
|
||||
<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="-1"
|
||||
>
|
||||
<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