aboutsummaryrefslogtreecommitdiff
path: root/src/lib/Utility
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-01-26 23:30:58 -0800
committerFuwn <[email protected]>2024-01-26 23:30:58 -0800
commit890149433f3b89625f6c9705308b033dd59d9913 (patch)
treef4a14531c6b1f6ab1d745d13d1d6e4df3f4239d7 /src/lib/Utility
parentfix(layout): eager identity fetch (diff)
downloaddue.moe-890149433f3b89625f6c9705308b033dd59d9913.tar.xz
due.moe-890149433f3b89625f6c9705308b033dd59d9913.zip
fix(updates): no details observer
Diffstat (limited to 'src/lib/Utility')
-rw-r--r--src/lib/Utility/html.ts10
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, '&nbsp;');
-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 }));
};