Merge pull request #18829 from shariquerik/page-menu-btn-fix

This commit is contained in:
Shariq Ansari 2022-11-10 14:34:45 +05:30 committed by GitHub
commit a434b5fb0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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);