Skip to content

Commit

Permalink
Make Popover generation more robust
Browse files Browse the repository at this point in the history
I used two different mechanisms for triggering.
  • Loading branch information
dokempf committed Oct 8, 2024
1 parent 7c40c59 commit 339be41
Showing 1 changed file with 8 additions and 5 deletions.
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

0 comments on commit 339be41

Please sign in to comment.