From fef904c6b16a83ee9aa6dfb7eff35d2934b07d19 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli <thomas@roundcube.net> Date: Fri, 26 Sep 2014 18:13:46 -0400 Subject: [PATCH] Enable/disable siganture commands before exiting the function in new compose window (#1490074) --- program/js/app.js | 24 +++++++++++++++--------- 1 files changed, 15 insertions(+), 9 deletions(-) diff --git a/program/js/app.js b/program/js/app.js index 8469dc8..323fd25 100644 --- a/program/js/app.js +++ b/program/js/app.js @@ -187,6 +187,11 @@ if (this.env.permaurl) this.enable_command('permaurl', 'extwin', true); + // initialize html editor + if (this.env.html_editor_init && window.rcmail_editor_init) { + rcmail_editor_init(this.env.html_editor_init); + } + switch (this.task) { case 'mail': @@ -3861,6 +3866,16 @@ if (!show_sig) show_sig = this.env.show_sig; + var id = obj.options[obj.selectedIndex].value; + + // enable manual signature insert + if (this.env.signatures && this.env.signatures[id]) { + this.enable_command('insert-sig', true); + this.env.compose_commands.push('insert-sig'); + } + else + this.enable_command('insert-sig', false); + // first function execution if (!this.env.identities_initialized) { this.env.identities_initialized = true; @@ -3871,7 +3886,6 @@ } var cursor_pos, p = -1, - id = obj.options[obj.selectedIndex].value, input_message = $("[name='_message']"), message = input_message.val(), is_html = ($("input[name='_is_html']").val() == '1'), @@ -3911,14 +3925,6 @@ if (old_val || new_val) input.val(input_val).change(); }); - - // enable manual signature insert - if (this.env.signatures && this.env.signatures[id]) { - this.enable_command('insert-sig', true); - this.env.compose_commands.push('insert-sig'); - } - else - this.enable_command('insert-sig', false); if (!is_html) { // remove the 'old' signature -- Gitblit v1.9.1