mirror of
https://github.com/ankitects/anki.git
synced 2025-12-08 04:16:56 -05:00
* Replace window.location in CardInfoDialog with load_sveltekit_page * Fix format * Fix ForgettingCurve's reactivity * Props' default args aren't reactive * Add global _updateCardId fn to card-info * Use _updateCardId to reactively update card-info * Fix format * Fix type * Use dummy form instead of window global for client-side nav * Fallback to window.location in case form hasn't been rendered * Use window.postMessage instead of dummy <form>
24 lines
669 B
Svelte
24 lines
669 B
Svelte
<!--
|
|
Copyright: Ankitects Pty Ltd and contributors
|
|
License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
-->
|
|
<script lang="ts">
|
|
import { page } from "$app/stores";
|
|
|
|
import CardInfo from "../CardInfo.svelte";
|
|
import type { PageData } from "./$types";
|
|
import { goto } from "$app/navigation";
|
|
|
|
export let data: PageData;
|
|
|
|
const showRevlog = $page.url.searchParams.get("revlog") !== "0";
|
|
|
|
function updateCardId(evt: MessageEvent) {
|
|
goto(`/card-info/${evt.data}`);
|
|
}
|
|
</script>
|
|
|
|
<!-- used by CardInfoDialog.update_card -->
|
|
<svelte:window on:message={updateCardId} />
|
|
|
|
<CardInfo stats={data.info} {showRevlog} />
|