Merge pull request #36315 from iamejaaz/sidebar-hidden

fix: hide worksapce and doctype if no space
This commit is contained in:
Ejaaz Khan 2026-01-25 19:05:02 +05:30 committed by GitHub
commit 3b42534f87
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -659,12 +659,18 @@ frappe.ui.form.Form = class FrappeForm {
let el = this.page.page_actions[0];
const rect = el.getBoundingClientRect();
let is_outside = rect.right > document.documentElement.clientWidth;
if (is_outside) {
// check if the default actions are outside of the screen
const overflow = Math.max(0, rect.right - document.documentElement.clientWidth);
this.page.$title_area
.parent()
.css("max-width", overflow ? `calc(50% - ${overflow}px)` : "50%");
if (!overflow) return;
let max_breadcrumb_width = Math.max(
290,
this.page.$title_area.find("ul").width() - overflow
);
this.page.$title_area.parent().css("max-width", `${max_breadcrumb_width}px`);
let breadcrumb = this.page.$title_area.find("ul li.ellipsis");
if (cint(breadcrumb[0]?.clientWidth) <= 30) {