From 96726424794a63f8a2ebb4f52bd5d79d1c66b807 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 28 Aug 2017 09:54:11 +0200 Subject: [PATCH] Cleanup compose input checks (small improvement to the last commit) --- program/js/app.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index f4f0f707e..80197e2a1 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -4502,9 +4502,6 @@ function rcube_webmail() } } - if (!this.check_compose_address_fields(cmd)) - return false; - // display localized warning for missing subject if (!this.env.nosubject_warned && input_subject.val() == '') { var dialog, @@ -4515,7 +4512,8 @@ function rcube_webmail() save_func = function() { input_subject.val(prompt_value.val()); dialog.dialog('close'); - ref.command(cmd, { nocheck:true }); // repeat command which triggered this + if (ref.check_compose_input(cmd)) + ref.command(cmd, { nocheck:true }); // repeat command which triggered this }; dialog = this.show_popup_dialog( @@ -4550,6 +4548,9 @@ function rcube_webmail() return false; } + if (!this.check_compose_address_fields(cmd)) + return false; + // move body from html editor to textarea (just to be sure, #1485860) this.editor.save(); @@ -4584,11 +4585,9 @@ function rcube_webmail() } // check for empty recipient - recipients = get_recipients([input_to, input_cc, input_bcc]); - if (!this.env.recipients_warned && !rcube_check_email(recipients, true)) { + if (!rcube_check_email(get_recipients([input_to, input_cc, input_bcc]), true)) { alert(this.get_label('norecipientwarning')); input_to.focus(); - this.env.recipients_warned = true; return false; }