]> Untitled Git - lemmy-ui.git/blob - src/shared/tippy.ts
fix submodule error
[lemmy-ui.git] / src / shared / tippy.ts
1 import { isBrowser } from "@utils/browser";
2 import tippy from "tippy.js";
3
4 export let tippyInstance: any;
5
6 if (isBrowser()) {
7   tippyInstance = tippy("[data-tippy-content]");
8 }
9
10 export function setupTippy() {
11   if (isBrowser()) {
12     tippyInstance.forEach((e: any) => e.destroy());
13     tippyInstance = tippy("[data-tippy-content]", {
14       delay: [500, 0],
15       // Display on "long press"
16       touch: ["hold", 500],
17     });
18   }
19 }