Browse Source

feat: Add document actions in mobile view

version-14
Gavin D'souza 4 years ago
parent
commit
6a1bbb2ff3
2 changed files with 16 additions and 3 deletions
  1. +10
    -3
      frappe/public/js/frappe/form/form.js
  2. +6
    -0
      frappe/public/scss/desk/global.scss

+ 10
- 3
frappe/public/js/frappe/form/form.js View File

@@ -1125,9 +1125,16 @@ 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 = this.page.add_menu_item(label, fn, false);
menu_item.parent().addClass("hidden-lg");

this.custom_buttons[label] = btn;
}
return btn;


+ 6
- 0
frappe/public/scss/desk/global.scss 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;


Loading…
Cancel
Save