summaryrefslogtreecommitdiff
path: root/skins
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-06-01 15:19:14 +0200
committerAleksander Machniak <alec@alec.pl>2013-06-01 15:19:14 +0200
commit15482bcadef86676864f7d498dc54f7c6a85c524 (patch)
tree3acb7b236384fca1439e0438c12cb767acb1e27f /skins
parentcb3e2fe0c2e36e0f41d93015fb1b604d195f9047 (diff)
Improved handling of Reply-To/Bcc addresses of identity in compose form (#1489016)
Diffstat (limited to 'skins')
-rw-r--r--skins/classic/functions.js10
-rw-r--r--skins/larry/ui.js12
2 files changed, 15 insertions, 7 deletions
diff --git a/skins/classic/functions.js b/skins/classic/functions.js
index d980627aa..1dcaa1586 100644
--- a/skins/classic/functions.js
+++ b/skins/classic/functions.js
@@ -492,14 +492,18 @@ switch_preview_pane: function(elem)
/* Message composing */
init_compose_form: function()
{
- var f, field, fields = ['cc', 'bcc', 'replyto', 'followupto'],
+ var f, v, field, fields = ['cc', 'bcc', 'replyto', 'followupto'],
div = document.getElementById('compose-div'),
headers_div = document.getElementById('compose-headers-div');
// Show input elements with non-empty value
for (f=0; f<fields.length; f++) {
- if ((field = $('#_'+fields[f])) && field.length && field.val() != '')
- rcmail_ui.show_header_form(fields[f]);
+ v = fields[f]; field = $('#_'+v);
+ if (field.length) {
+ field.on('change', {v:v}, function(e) { if (this.value) rcmail_ui.show_header_form(e.data.v); });
+ if (field.val() != '')
+ rcmail_ui.show_header_form(v);
+ }
}
// prevent from form data loss when pressing ESC key in IE
diff --git a/skins/larry/ui.js b/skins/larry/ui.js
index 693448097..096369a88 100644
--- a/skins/larry/ui.js
+++ b/skins/larry/ui.js
@@ -111,10 +111,14 @@ function rcube_mail_ui()
layout_composeview();
// Show input elements with non-empty value
- var field, fields = ['cc', 'bcc', 'replyto', 'followupto'];
- for (var f=0; f < fields.length; f++) {
- if ((field = $('#_'+fields[f])) && field.length && field.val() != '')
- show_header_row(fields[f], true);
+ var f, v, field, fields = ['cc', 'bcc', 'replyto', 'followupto'];
+ for (f=0; f < fields.length; f++) {
+ v = fields[f]; field = $('#_'+v);
+ if (field.length) {
+ field.on('change', {v: v}, function(e) { if (this.value) show_header_row(e.data.v, true); });
+ if (field.val() != '')
+ show_header_row(v, true);
+ }
}
$('#composeoptionstoggle').click(function(){