diff options
author | Aleksander Machniak <alec@alec.pl> | 2014-07-21 11:26:01 +0200 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2014-07-21 11:26:01 +0200 |
commit | be6a095f83bea9d21002186de4dfdb6e934ddc3e (patch) | |
tree | c515d2d359410b45724b402a1b1f49d0a8d63887 /program/js | |
parent | e7ce974ebc118f6ae9c691455097e07ed1fd7515 (diff) |
Use jQuery.each instead of "for (i in Array)" (#1489988)
Diffstat (limited to 'program/js')
-rw-r--r-- | program/js/app.js | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/program/js/app.js b/program/js/app.js index 1cc184dea..1bf35e412 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3981,18 +3981,16 @@ function rcube_webmail() return; } - var i, rx, - id = obj.options[obj.selectedIndex].value, + var id = obj.options[obj.selectedIndex].value, sig = this.env.identity, delim = this.env.recipients_separator, - rx_delim = RegExp.escape(delim), - headers = ['replyto', 'bcc']; + rx_delim = RegExp.escape(delim); // update reply-to/bcc fields with addresses defined in identities - for (i in headers) { - var key = headers[i], - old_val = sig && this.env.identities[sig] ? this.env.identities[sig][key] : '', - new_val = id && this.env.identities[id] ? this.env.identities[id][key] : '', + $.each(['replyto', 'bcc'], function() { + var rx, key = this, + old_val = sig && ref.env.identities[sig] ? ref.env.identities[sig][key] : '', + new_val = id && ref.env.identities[id] ? ref.env.identities[id][key] : '', input = $('[name="_'+key+'"]'), input_val = input.val(); // remove old address(es) @@ -4019,7 +4017,7 @@ function rcube_webmail() if (old_val || new_val) input.val(input_val).change(); - } + }); // enable manual signature insert if (this.env.signatures && this.env.signatures[id]) { |