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 |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/program/js/app.js b/program/js/app.js
index e6b1d84..323fd25 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3866,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;
@@ -3876,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'),
@@ -3916,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