mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Revert "Fix/Retention help button bounds (#4253)"
This reverts commit 5462d99255
.
This commit is contained in:
parent
a0c1a398f4
commit
1bcbf77ebb
3 changed files with 20 additions and 16 deletions
|
@ -12,7 +12,7 @@ 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;
|
||||
export let onTitleClick: ((_e: MouseEvent | KeyboardEvent) => void) | null = null;
|
||||
</script>
|
||||
|
||||
<div
|
||||
|
@ -25,21 +25,25 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
style:--container-margin="0"
|
||||
>
|
||||
<div class="position-relative">
|
||||
<h1>
|
||||
{title}
|
||||
</h1>
|
||||
{#if onHelpClick}
|
||||
<div
|
||||
on:click={onHelpClick}
|
||||
on:keydown={onHelpClick}
|
||||
{#if onTitleClick}
|
||||
<span
|
||||
on:click={onTitleClick}
|
||||
on:keydown={onTitleClick}
|
||||
role="button"
|
||||
tabindex="0"
|
||||
class="help-badge position-absolute"
|
||||
class:rtl
|
||||
>
|
||||
<slot name="tooltip" />
|
||||
</div>
|
||||
<h1>
|
||||
{title}
|
||||
</h1>
|
||||
</span>
|
||||
{:else}
|
||||
<h1>
|
||||
{title}
|
||||
</h1>
|
||||
{/if}
|
||||
<div class="help-badge position-absolute" class:rtl>
|
||||
<slot name="tooltip" />
|
||||
</div>
|
||||
</div>
|
||||
<slot />
|
||||
</div>
|
||||
|
|
|
@ -8,7 +8,7 @@ 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;
|
||||
export let onTitleClick: ((_e: MouseEvent | KeyboardEvent) => void) | null = null;
|
||||
</script>
|
||||
|
||||
{#if title == null}
|
||||
|
@ -19,7 +19,7 @@ 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}>
|
||||
<TitledContainer class="d-flex flex-column" {title} {onTitleClick}>
|
||||
<slot slot="tooltip" name="tooltip"></slot>
|
||||
<div class="graph d-flex flex-grow-1 flex-column justify-content-center">
|
||||
{#if subtitle}
|
||||
|
|
|
@ -57,12 +57,12 @@ License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|||
|
||||
const title = tr.statisticsTrueRetentionTitle();
|
||||
const subtitle = tr.statisticsTrueRetentionSubtitle();
|
||||
const onHelpClick = () => {
|
||||
const onTitleClick = () => {
|
||||
openHelpModal(Object.keys(retentionHelp).indexOf("trueRetention"));
|
||||
};
|
||||
</script>
|
||||
|
||||
<Graph {title} {subtitle} {onHelpClick}>
|
||||
<Graph {title} {subtitle} {onTitleClick}>
|
||||
<HelpModal
|
||||
title={tr.statisticsTrueRetentionTitle()}
|
||||
url={HelpPage.DeckOptions.fsrs}
|
||||
|
|
Loading…
Reference in a new issue