diff options
Diffstat (limited to 'src/lib/Utility')
| -rw-r--r-- | src/lib/Utility/html.ts | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/Utility/html.ts b/src/lib/Utility/html.ts index a41cda9f..8a0b7888 100644 --- a/src/lib/Utility/html.ts +++ b/src/lib/Utility/html.ts @@ -3,7 +3,7 @@ import { get } from 'svelte/store'; export const nbsp = (str: string) => str.replace(/ /g, ' '); -export const createHeightObserver = () => { +export const createHeightObserver = (details = true) => { const heightObserver = new ResizeObserver(() => { if (get(settings).displayLimitListHeight) { document.querySelectorAll('.list').forEach((list) => { @@ -27,7 +27,9 @@ export const createHeightObserver = () => { }); document.querySelectorAll('.list').forEach((element) => heightObserver.observe(element)); - document - .querySelectorAll('.list') - .forEach((element) => collapseObserver.observe(element, { attributes: true })); + + if (details) + document + .querySelectorAll('.list') + .forEach((element) => collapseObserver.observe(element, { attributes: true })); }; |