From 3b944edb02a838e92f5f849b1266f157ccfb7040 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 8 Jul 2013 10:53:06 +0200 Subject: Fix bug where signature wasn't changed on identity selection when editing a draft (#1489229) --- CHANGELOG | 1 + program/js/app.js | 11 ++++++++++- program/steps/mail/compose.inc | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 64b9d079f..8dc8d4b0f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix bug where signature wasn't changed on identity selection when editing a draft (#1489229) - Fix IMAP SETMETADATA parameters quoting (#1489231) - Add support for 'enchant' spellcheck engine - Fix "could not load message" error on valid empty message body (#1489228) diff --git a/program/js/app.js b/program/js/app.js index 19ece01d2..04fb9cdb4 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -3065,7 +3065,7 @@ function rcube_webmail() this.set_caret_pos(input_message, this.env.top_posting ? 0 : $(input_message).val().length); // add signature according to selected identity // if we have HTML editor, signature is added in callback - if (input_from.prop('type') == 'select-one' && !this.env.opened_extwin) { + if (input_from.prop('type') == 'select-one') { this.change_identity(input_from[0]); } } @@ -3402,6 +3402,15 @@ function rcube_webmail() if (!show_sig) show_sig = this.env.show_sig; + // first function execution + if (!this.env.identities_initialized) { + this.env.identities_initialized = true; + if (this.env.show_sig_later) + this.env.show_sig = true; + if (this.env.opened_extwin) + return; + } + var i, rx, cursor_pos, p = -1, id = obj.options[obj.selectedIndex].value, input_message = $("[name='_message']"), diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 329f63ee0..08e0ad4c5 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -170,6 +170,9 @@ $OUTPUT->set_env('compose_mode', $compose_mode); $config_show_sig = $RCMAIL->config->get('show_sig', 1); if ($compose_mode == RCUBE_COMPOSE_EDIT || $compose_mode == RCUBE_COMPOSE_DRAFT) { // don't add signature in draft/edit mode, we'll also not remove the old-one + // but only on page display, later we should be able to change identity/sig (#1489229) + if ($config_show_sig == 1 || $config_show_sig == 2) + $OUTPUT->set_env('show_sig_later', true); } else if ($config_show_sig == 1) $OUTPUT->set_env('show_sig', true); -- cgit v1.2.3