diff --git a/src/lib/components/lemmy/post/PostBody.svelte b/src/lib/components/lemmy/post/PostBody.svelte index 4d06addb..853d8a63 100644 --- a/src/lib/components/lemmy/post/PostBody.svelte +++ b/src/lib/components/lemmy/post/PostBody.svelte @@ -6,7 +6,16 @@ export let body: string export let view: View = 'cozy' + let overflows = false let expanded = false + + function isOverflown(element: Element) { + overflows = + element.scrollHeight > element.clientHeight || + element.scrollWidth > element.clientWidth + + if (!overflows) expanded = true + }
- + {#if overflows} + + {/if}
diff --git a/src/lib/components/ui/Navbar.svelte b/src/lib/components/ui/Navbar.svelte index 5aa546d9..05c0f037 100644 --- a/src/lib/components/ui/Navbar.svelte +++ b/src/lib/components/ui/Navbar.svelte @@ -53,7 +53,7 @@