Merge branch 'develop' into fix-13167

This commit is contained in:
Suraj Shetty 2021-05-20 09:58:04 +05:30 committed by GitHub
commit 24244d1c7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 20 additions and 5 deletions

View file

@ -289,7 +289,7 @@ frappe.Application = class Application {
}
if (!frappe.workspaces['home']) {
// default workspace is settings for Frappe
frappe.workspaces['home'] = frappe.workspaces['build'];
frappe.workspaces['home'] = frappe.workspaces[Object.keys(frappe.workspaces)[0]];
}
}

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;

View file

@ -505,8 +505,9 @@ window.print();
// close the window after print
// NOTE: doesn't close if print is cancelled in Chrome
// Changed timeout to 5s from 1s because it blocked mobile view rendering
setTimeout(function() {
window.close();
}, 1000);
}, 5000);
</script>
"""