summaryrefslogtreecommitdiff
path: root/program/js
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2012-11-12 09:16:22 +0100
committerAleksander Machniak <alec@alec.pl>2012-11-12 09:17:44 +0100
commita38cd0f12a29ba323c1edaa7fbd1f51572454304 (patch)
treec84b70606008c9a17e3cd98fe681fa7004eef514 /program/js
parentac0c8537ad776c9852a9ef7b64ac76bd2c2e068c (diff)
Fix excessive LFs at the end of composed message with top_posting=true (#1488797)
Conflicts: CHANGELOG
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;