Merge pull request #18829 from shariquerik/page-menu-btn-fix
This commit is contained in:
commit
a434b5fb0d
1 changed files with 7 additions and 3 deletions
|
|
@ -327,13 +327,14 @@ frappe.ui.Page = class Page {
|
|||
|
||||
//--- Menu --//
|
||||
|
||||
add_menu_item(label, click, standard, shortcut) {
|
||||
add_menu_item(label, click, standard, shortcut, show_parent) {
|
||||
return this.add_dropdown_item({
|
||||
label,
|
||||
click,
|
||||
standard,
|
||||
parent: this.menu,
|
||||
shortcut,
|
||||
show_parent,
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -424,7 +425,7 @@ frappe.ui.Page = class Page {
|
|||
icon = null,
|
||||
}) {
|
||||
if (show_parent) {
|
||||
parent.parent().removeClass("hide");
|
||||
parent.parent().removeClass("hide hidden-xl");
|
||||
}
|
||||
|
||||
let $link = this.is_in_group_button_dropdown(parent, "li > a.grey-link > span", label);
|
||||
|
|
@ -602,8 +603,11 @@ frappe.ui.Page = class Page {
|
|||
};
|
||||
// Add actions as menu item in Mobile View
|
||||
let menu_item_label = group ? `${group} > ${label}` : label;
|
||||
let menu_item = this.add_menu_item(menu_item_label, _action, false);
|
||||
let menu_item = this.add_menu_item(menu_item_label, _action, false, false, false);
|
||||
menu_item.parent().addClass("hidden-xl");
|
||||
if (this.menu_btn_group.hasClass("hide")) {
|
||||
this.menu_btn_group.removeClass("hide").addClass("hidden-xl");
|
||||
}
|
||||
|
||||
if (group) {
|
||||
var $group = this.get_or_add_inner_group_button(group);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue