fix: Section collapse in modal (#12536)

Co-authored-by: Suraj Shetty <13928957+surajshetty3416@users.noreply.github.com>
This commit is contained in:
rohitwaghchaure 2021-03-09 11:48:24 +05:30 committed by GitHub
parent b44ee08a19
commit c1ab5b8479
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -289,7 +289,7 @@ frappe.ui.form.Layout = Class.extend({
},
refresh_section_collapse: function () {
if (!this.doc) return;
if (!(this.sections && this.sections.length)) return;
for (var i = 0; i < this.sections.length; i++) {
var section = this.sections[i];

View file

@ -52,6 +52,8 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.FieldGroup {
// make fields (if any)
super.make();
this.refresh_section_collapse();
// show footer
this.action = this.action || { primary: { }, secondary: { } };
if (this.primary_action || (this.action.primary && this.action.primary.onsubmit)) {