Merge pull request #13619 from gavindsouza/hide-attachment-cond-dev
fix: Hide "Attach File" in form if max limit reached
This commit is contained in:
commit
3e92cf2f0e
1 changed files with 2 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ frappe.ui.form.Attachments = class Attachments {
|
|||
this.parent.find(".add-attachment-btn").click(function() {
|
||||
me.new_attachment();
|
||||
});
|
||||
this.add_attachment_wrapper = this.parent.find(".add_attachment").parent();
|
||||
this.add_attachment_wrapper = this.parent.find(".add-attachment-btn");
|
||||
this.attachments_label = this.parent.find(".attachments-label");
|
||||
}
|
||||
max_reached(raise_exception=false) {
|
||||
|
|
@ -39,7 +39,7 @@ frappe.ui.form.Attachments = class Attachments {
|
|||
this.parent.find(".attachment-row").remove();
|
||||
|
||||
var max_reached = this.max_reached();
|
||||
this.add_attachment_wrapper.toggleClass("hide", !max_reached);
|
||||
this.add_attachment_wrapper.toggle(!max_reached);
|
||||
|
||||
// add attachment objects
|
||||
var attachments = this.get_attachments();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue