summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
Diffstat (limited to 'program/js')
-rw-r--r--program/js/app.js4
1 files changed, 4 insertions, 0 deletions
diff --git a/program/js/app.js b/program/js/app.js
index 1211d4a29..4ee272c4c 100644
--- a/program/js/app.js
+++ b/program/js/app.js
@@ -3300,6 +3300,10 @@ function rcube_webmail()
message = message.substring(0, p) + sig + message.substring(p, message.length);
cursor_pos = p - 1;
}
+ else if (!message) { // empty message
+ cursor_pos = 0;
+ message = '\n\n' + sig;
+ }
else if (pos = this.get_caret_pos(input_message.get(0))) { // at cursor position
message = message.substring(0, pos) + '\n' + sig + '\n\n' + message.substring(pos, message.length);
cursor_pos = pos;