fix: only show menu button if it contains action items

This commit is contained in:
Shariq Ansari 2023-05-27 14:59:58 +05:30
parent 7fdc6007ba
commit 064caaa3b4

View file

@ -113,6 +113,9 @@ class FormBuilder {
this.go_to_doctype_btn.hide();
this.go_to_customize_form_btn.hide();
this.page.menu_btn_group.show();
let hide_menu = true;
// show customize form & Go to customize form btn
if (
this.store.doc &&
@ -147,6 +150,10 @@ class FormBuilder {
this.go_to_doctype_list_btn.text(label).show();
}
if (hide_menu && window.matchMedia("(min-device-width: 992px)").matches) {
this.page.menu_btn_group.hide();
}
// toggle preview btn text
this.preview_btn.text(this.store.preview ? __("Hide Preview") : __("Show Preview"));