Skip to content

Commit

Permalink
fix(nextPrev): 🐛 hoverPreview now works on NextPrev View (fix #356)
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Apr 17, 2022
1 parent eecfe5f commit 8191522
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Components/NextPrev.svelte
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script lang="ts">
import { openOrSwitch } from "obsidian-community-lib";
import { openOrSwitch, hoverPreview } from "obsidian-community-lib";
import type { SquareItem } from "../interfaces";
import type BCPlugin from "../main";
import { linkClass } from "../Utils/ObsidianUtils";
Expand All @@ -9,6 +9,8 @@
export let prev: SquareItem[];
const { app } = plugin;
const activeLeafView = app.workspace.activeLeaf.view;
</script>

<div class="BC-NextPrev-Container">
Expand All @@ -18,6 +20,7 @@
<div
class="{linkClass(app, to, real)} BC-prev"
on:click={async (e) => await openOrSwitch(app, to, e)}
on:mouseover={(e) => hoverPreview(e, activeLeafView, to)}
>
<strong>{field}</strong>
{to}
Expand All @@ -31,6 +34,7 @@
<div
class="{linkClass(app, to, real)} BC-next"
on:click={async (e) => await openOrSwitch(app, to, e)}
on:mouseover={(e) => hoverPreview(e, activeLeafView, to)}
>
{to} <strong>{field}</strong>
</div>
Expand Down

0 comments on commit 8191522

Please sign in to comment.