diff options
author | Dessalines <tyhou13@gmx.com> | 2020-03-03 02:29:45 -0500 |
---|---|---|
committer | Dessalines <tyhou13@gmx.com> | 2020-03-03 02:29:45 -0500 |
commit | 44bbc459736ac53b9150903af14c20a497caf9ab (patch) | |
tree | 0bf8899cfc448e7b70230de52cec9119aa43f011 /ui/src/utils.ts | |
parent | 5f6f51b549d42943b85d8f7dc9d193aec0935ab6 (diff) |
A first pass at adding icons, and tippy tooltips.
- Adding icons for post-listing, comment-node, and navbar.
- Adding html titles.
- Updating moment expand to use users locale.
Diffstat (limited to 'ui/src/utils.ts')
-rw-r--r-- | ui/src/utils.ts | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 66105720..7ef3e303 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -41,6 +41,7 @@ import markdown_it_container from 'markdown-it-container'; import twemoji from 'twemoji'; import emojiShortName from 'emoji-short-name'; import Toastify from 'toastify-js'; +import tippy from 'tippy.js'; export const repoUrl = 'https://github.com/dessalines/lemmy'; export const markdownHelpUrl = '/docs/about_guide.html'; @@ -477,6 +478,17 @@ export function setupTribute(): Tribute { }); } +let tippyInstance = tippy('[data-tippy-content]'); + +export function setupTippy() { + tippyInstance.forEach(e => e.destroy()); + tippyInstance = tippy('[data-tippy-content]', { + delay: [500, 0], + // Display on "long press" + touch: ['hold', 500], + }); +} + function userSearch(text: string, cb: any) { if (text) { let form: SearchForm = { |