Merge pull request #13247 from gavindsouza/doc-actions-mobile

This commit is contained in:
Suraj Shetty 2021-05-20 09:40:33 +05:30 committed by GitHub
commit 00af014cca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 3 deletions

View file

@ -1125,9 +1125,17 @@ frappe.ui.form.Form = class FrappeForm {
add_custom_button(label, fn, group) {
// temp! old parameter used to be icon
if(group && group.indexOf("fa fa-")!==-1) group = null;
var btn = this.page.add_inner_button(label, fn, group);
if(btn) {
if (group && group.indexOf("fa fa-") !== -1)
group = null;
let btn = this.page.add_inner_button(label, fn, group);
if (btn) {
// Add actions as menu item in Mobile View
let menu_item_label = group ? `${group} > ${label}` : label;
let menu_item = this.page.add_menu_item(menu_item_label, fn, false);
menu_item.parent().addClass("hidden-lg");
this.custom_buttons[label] = btn;
}
return btn;

View file

@ -120,6 +120,12 @@ pre {
}
}
.hidden-lg {
@include media-breakpoint-up(md) {
display: none !important;
}
}
.visible-xs {
@include media-breakpoint-up(sm) {
display: none !important;