PluginProbe
Extendify / 3.2.1
Extendify v3.2.1
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / src / Agent / lib / extendable-header.js

extendable-header.js in Extendify 3.2.1, at src/Agent/lib/extendable-header.js

23 lines 654 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 const PART_ATTR = 'data-extendify-part';
2
3 // A header wearing any of these is positioned by the theme, not inline CSS.
4 const HEADER_CLASSES = [
5 'ext-header-sticky',
6 'ext-header-sticky--floating-pill',
7 'ext-header-overlay',
8 'ext-header-glass',
9 'ext-header--dark',
10 ];
11
12 const headerBlockEl = () =>
13 [...document.querySelectorAll(`[${PART_ATTR}="header"]`)].find(
14 (el) => !el.parentElement?.closest(`[${PART_ATTR}="header"]`),
15 ) ?? null;
16
17 export const isExtendableHeader = () => {
18 const el = headerBlockEl();
19 if (!el) return false;
20 const classes = String(el.className).split(/\s+/);
21 return HEADER_CLASSES.some((cls) => classes.includes(cls));
22 };
23