Cap content-area height on every page, fix scroll bugs, sidebar accordion
- Apply the taskbar's max-height/overflow-y:auto treatment to #wpbody-content unconditionally, so tall native/Aurora pages (Add Plugins, Add User, Profile, Fonts, file editors, Settings, Activity Log, Database Explorer, Comments) scroll internally within their frame instead of growing past the viewport and scrolling the whole document. - Fix a Chrome scroll-anchoring bug this surfaced on Add Plugins (page loaded scrolled ~1700px into content instead of at the top) via overflow-anchor: none. - Fix a phantom document-level scrollbar with dead space below the frame by locking html/body's own overflow, since the sidebar/toolbar are fixed and content is only ever meant to scroll internally. - Make the sidebar's native-menu sections a single-open accordion: expanding one now collapses whichever else was open. Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
8153d4397c
commit
73591e0ca4
@@ -63,21 +63,16 @@ const isSectionActive = (item) => {
|
||||
return (item.submenu || []).some((sub) => normalize(sub.url) === current.value);
|
||||
};
|
||||
|
||||
// Which sections are manually expanded. Active section starts expanded.
|
||||
const expanded = ref(new Set());
|
||||
// Accordion: only one section's submenu open at a time, so expanding one
|
||||
// closes the rest instead of the list growing indefinitely. Starts on
|
||||
// whichever section is active (each nav is a full page load in this
|
||||
// multi-page admin, so there's no need to react to URL changes afterward).
|
||||
const openId = ref(props.menu.find((item) => isSectionActive(item))?.id ?? null);
|
||||
|
||||
const isExpanded = (item) => {
|
||||
return expanded.value.has(item.id) || isSectionActive(item);
|
||||
};
|
||||
const isExpanded = (item) => openId.value === item.id;
|
||||
|
||||
const toggle = (item) => {
|
||||
const next = new Set(expanded.value);
|
||||
if (next.has(item.id)) {
|
||||
next.delete(item.id);
|
||||
} else {
|
||||
next.add(item.id);
|
||||
}
|
||||
expanded.value = next;
|
||||
openId.value = openId.value === item.id ? null : item.id;
|
||||
};
|
||||
|
||||
// Aurora's own branded nav section (Settings, Menu Creator, Admin Notices,
|
||||
|
||||
Reference in New Issue
Block a user