Polish sticky headers, Custom View, docs page and dialogs
- Status tables: the whole header (column names + filters) sticks as one block, tucked 1px under the group header, so no gap can open between the rows; offsets use fractional heights - Phones/tablets: the filter panel sticks under the group header too, and is opaque and compact (three filters per row on phones) - Custom View: fix the group header being pushed over the column header (it lives inside the view's own scroll box); the column header now pins to the top of that box on desktop, and the header strip sticks on phones - All Devices: group title is "All Devices (N)" instead of "Missing Software", matching the page title count - Documentation fits the window on desktop: only the article list and the article scroll; placeholder no longer says "from the left" - Dialogs sit above the terminal dock so it can't cover their last rows; page bottom padding follows the dock's measured height
This commit is contained in:
1 parent
a85c22b2b9
commit
d24be4a2d6
4 files changed
+73
-25
No files matched your search
+18
-7
@@ -87,16 +87,19 @@
|
||||
return null;
|
||||
}
|
||||
function updateSticky() {
|
||||
const root = document.documentElement;
|
||||
const nav = document.querySelector('.top-nav');
|
||||
const navH = nav ? nav.offsetHeight : 60;
|
||||
setVar(document.documentElement, '--nav-h', navH + 'px');
|
||||
const navH = nav ? nav.getBoundingClientRect().height : 60;
|
||||
setVar(root, '--nav-h', navH + 'px');
|
||||
const dock = document.getElementById('usmt-term');
|
||||
setVar(root, '--dock-h', (dock ? Math.ceil(dock.getBoundingClientRect().height) : 0) + 'px');
|
||||
|
||||
document.querySelectorAll('table.master-table').forEach(table => {
|
||||
if (!table.offsetParent) return; // hidden page/group: keep old values
|
||||
const gh = groupHeaderFor(table);
|
||||
const ghH = gh ? gh.offsetHeight : 0;
|
||||
const firstRow = table.tHead && table.tHead.rows[0];
|
||||
if (!firstRow || !firstRow.offsetHeight) return; // hidden page/group: keep old values
|
||||
setVar(table, '--sticky-top', (navH + ghH) + 'px');
|
||||
setVar(table, '--thead-r1', firstRow.offsetHeight + 'px');
|
||||
const ghH = gh && getComputedStyle(gh).position === 'sticky' ? gh.getBoundingClientRect().height : 0;
|
||||
// 1px overlap tucks the table header under the group header: no hairline gap
|
||||
setVar(table, '--sticky-top', Math.max(0, navH + ghH - 1) + 'px');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -121,6 +124,14 @@
|
||||
// Groups and pages are shown by toggling display (not a DOM change), so also
|
||||
// re-measure as the user scrolls; writes only happen when a value changes.
|
||||
window.addEventListener('scroll', schedule, { passive: true });
|
||||
// The terminal dock opens, closes and resizes without a page resize
|
||||
if (window.ResizeObserver) {
|
||||
const watchDock = () => {
|
||||
const dock = document.getElementById('usmt-term');
|
||||
if (dock) new ResizeObserver(schedule).observe(dock); else setTimeout(watchDock, 500);
|
||||
};
|
||||
watchDock();
|
||||
}
|
||||
schedule();
|
||||
}
|
||||
if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start);
|
||||
|
||||
Reference in new issue
Block a user