Merge pull request #36315 from iamejaaz/sidebar-hidden
fix: hide worksapce and doctype if no space
This commit is contained in:
commit
3b42534f87
1 changed files with 9 additions and 3 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue