fix: don't show empty menu in form view

Signed-off-by: Akhil Narang <me@akhilnarang.dev>
This commit is contained in:
Akhil Narang 2025-10-31 11:33:02 +05:30
parent bbd966f327
commit 7a0f6b6f3f
No known key found for this signature in database
GPG key ID: 9DCC61E211BF645F

View file

@ -26,7 +26,11 @@ frappe.ui.form.Toolbar = class Toolbar {
this.page.hide_menu();
this.print_icon && this.print_icon.addClass("hide");
} else {
this.page.show_menu();
if (this.page.menu.children().length > 0) {
this.page.show_menu();
} else {
this.page.hide_menu();
}
this.print_icon && this.print_icon.removeClass("hide");
}
}