sidebar: stop anchoring on collapse-sidebar-link in v16.17
Frappe v16.17 reintroduced .collapse-sidebar-link as a tiny icon-button inside a horizontal flex row (.sidebar-bottom-actions). Our v15 fallback was finding it and inserting our three labeled links into that flex row, pushing them off the right edge of the sidebar. Anchor only on .body-sidebar-bottom now. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
94b6f4f75e
commit
534c98e062
|
|
@ -678,11 +678,12 @@
|
||||||
(function () {
|
(function () {
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
// Frappe v15 had a "Collapse" link we inserted before; v16 removed it.
|
// Insert our labeled sidebar links at the top of .body-sidebar-bottom.
|
||||||
// Fall back to body-sidebar-bottom as the parent in v16.
|
// We don't anchor on .collapse-sidebar-link anymore — Frappe brought it
|
||||||
|
// back in v16.17 as a tiny icon-button inside a horizontal flex row
|
||||||
|
// (.sidebar-bottom-actions), so inserting before it would push our links
|
||||||
|
// into that row and overflow the sidebar.
|
||||||
window.jeySidebarAnchor = window.jeySidebarAnchor || function () {
|
window.jeySidebarAnchor = window.jeySidebarAnchor || function () {
|
||||||
var v15 = document.querySelector(".collapse-sidebar-link");
|
|
||||||
if (v15) return { parent: v15.parentNode, before: v15 };
|
|
||||||
var bottom = document.querySelector(".body-sidebar .body-sidebar-bottom");
|
var bottom = document.querySelector(".body-sidebar .body-sidebar-bottom");
|
||||||
if (bottom) return { parent: bottom, before: bottom.firstChild };
|
if (bottom) return { parent: bottom, before: bottom.firstChild };
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue