Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Popover generation more robust #61

Merged
merged 1 commit into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions src/components/fields/Link.svelte
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<script>
import { onMount } from "svelte";

import { fieldData, hasField, standardHasAsset, selectStandardAsset } from "../../lib/easydbHelpers";
import { dataLanguagesStore, pushSystemID, masksToRenderStore } from "../../lib/stores";
import { A, Breadcrumb, BreadcrumbItem, Card, P, Popover } from "flowbite-svelte";
Expand All @@ -22,13 +24,14 @@
return !($masksToRenderStore.includes(fdata._mask));
}

onMount(() => {
detailViewComponent = import("../logic/DetailViewImpl.svelte");
});

function handleClick() {
if(!requiresPopover()) {
pushSystemID(fdata._system_object_id);
}
else {
detailViewComponent = import("../logic/DetailViewImpl.svelte");
}
}

function hasNontrivialPath() {
Expand Down Expand Up @@ -66,13 +69,13 @@
{/if}
{#if standardHasAsset(fdata)}
<Card class="easydb-link max-w-full h-32" img={selectStandardAsset(fdata)} horizontal>
<A id="link" on:click={handleClick}>
<A id="link" href={null} on:click={handleClick}>
{fdata["_standard"]["1"].text[$dataLanguagesStore[0]]}
</A>
</Card>
{:else}
<span class="easydb-link">
<A id="link" on:click={handleClick}>
<A id="link" href={null} on:click={handleClick}>
{fdata["_standard"]["1"].text[$dataLanguagesStore[0]]}
</A>
</span>
Expand Down