fix(print page): additional menu in mobile view print pageversion-14
@@ -52,8 +52,8 @@ frappe.ui.form.PrintView = class { | |||||
':Print Settings', | ':Print Settings', | ||||
'Print Settings' | 'Print Settings' | ||||
); | ); | ||||
this.setup_toolbar(); | |||||
this.setup_menu(); | this.setup_menu(); | ||||
this.setup_toolbar(); | |||||
this.setup_sidebar(); | this.setup_sidebar(); | ||||
this.setup_keyboard_shortcuts(); | this.setup_keyboard_shortcuts(); | ||||
} | } | ||||
@@ -81,8 +81,9 @@ frappe.ui.form.PrintView = class { | |||||
); | ); | ||||
this.page.add_button( | this.page.add_button( | ||||
frappe.utils.icon('refresh'), | |||||
() => this.refresh_print_format() | |||||
__('Refresh'), | |||||
() => this.refresh_print_format(), | |||||
{ icon: 'refresh' } | |||||
); | ); | ||||
} | } | ||||
@@ -714,6 +714,10 @@ frappe.ui.Page = class Page { | |||||
${opts.icon ? frappe.utils.icon(opts.icon): ''} | ${opts.icon ? frappe.utils.icon(opts.icon): ''} | ||||
${label} | ${label} | ||||
</button>`); | </button>`); | ||||
// Add actions as menu item in Mobile View (similar to "add_custom_button" in forms.js) | |||||
let menu_item = this.add_menu_item(label, click, false); | |||||
menu_item.parent().addClass("hidden-xl"); | |||||
button.appendTo(this.custom_actions); | button.appendTo(this.custom_actions); | ||||
button.on('click', click); | button.on('click', click); | ||||
this.custom_actions.removeClass('hide'); | this.custom_actions.removeClass('hide'); | ||||