console fix 1
This commit is contained in:
1 parent
69f113891f
commit
8da0d884ed
1 file changed
+5
-1
@@ -4,6 +4,7 @@
|
|||||||
// incrementversion DISMISSED_KEY
|
// incrementversion DISMISSED_KEY
|
||||||
const DISMISSED_KEY = 'jf-banner-dismissed-v1';
|
const DISMISSED_KEY = 'jf-banner-dismissed-v1';
|
||||||
const BANNER_ID = 'custom-announcement-banner';
|
const BANNER_ID = 'custom-announcement-banner';
|
||||||
|
const SCRIPT_START = Date.now();
|
||||||
|
|
||||||
// Edit these to change banner content:
|
// Edit these to change banner content:
|
||||||
const BANNER_HTML = `
|
const BANNER_HTML = `
|
||||||
@@ -100,7 +101,10 @@
|
|||||||
offsetElements.add(el);
|
offsetElements.add(el);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (offsetPx > 0 && candidates.size === 0) {
|
// Jellyfin's SPA mounts its header asynchronously after DOMContentLoaded,
|
||||||
|
// so an empty result in the first few seconds is expected, not a bug.
|
||||||
|
// Only warn once things have had time to settle.
|
||||||
|
if (offsetPx > 0 && candidates.size === 0 && Date.now() - SCRIPT_START > 4000) {
|
||||||
console.warn('[custom-banner] No fixed top navigation elements detected to push down; banner may overlap the menu.');
|
console.warn('[custom-banner] No fixed top navigation elements detected to push down; banner may overlap the menu.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user