refactor: consolidate CommunicationComposer get_content_field method
This commit is contained in:
parent
e8d1d40ff1
commit
ab52f39b94
1 changed files with 5 additions and 9 deletions
|
|
@ -260,10 +260,11 @@ frappe.views.CommunicationComposer = class {
|
|||
}
|
||||
|
||||
get_content_field() {
|
||||
const content_field = this.dialog.fields_dict.use_html.value
|
||||
? this.dialog.fields_dict.html_content
|
||||
: this.dialog.fields_dict.content;
|
||||
return content_field;
|
||||
if (this.dialog.fields_dict.use_html.value) {
|
||||
return this.dialog.fields_dict.html_content;
|
||||
} else {
|
||||
return this.dialog.fields_dict.content;
|
||||
}
|
||||
}
|
||||
|
||||
get_default_recipients(fieldname) {
|
||||
|
|
@ -1068,11 +1069,6 @@ frappe.views.CommunicationComposer = class {
|
|||
return text.replace(/\n{3,}/g, "\n\n");
|
||||
}
|
||||
|
||||
get_content_field() {
|
||||
const use_html = this.dialog.get_value("use_html");
|
||||
return use_html ? this.dialog.fields_dict.content_html : this.dialog.fields_dict.content;
|
||||
}
|
||||
|
||||
get_email_content() {
|
||||
return this.get_content_field().get_value() || "";
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue