Re-focus on the compose box after a send, auto-move cursor

Re-focuses on the compose box after a send, under these conditions:
1) narrowed to stream+subject -or- responding to PM/huddle
2) compose was initiated by clicking on a message or hitting "r"/"enter"
3) cursor has not moved since you've started the composition

Additionally, if you are thus narrowed, we will move your cursor when you've sent
a message to that message, assuming that such a message initially appears visible.

(imported from commit 373c858081694e6fc9994639340a847d66edb566)
This commit is contained in:
acrefoot
2013-05-16 17:16:15 -04:00
parent 66b93d5cfd
commit 6ae117ea5f
3 changed files with 47 additions and 3 deletions

View File

@@ -357,9 +357,12 @@ function send_message() {
$("#compose-send-button").removeAttr('disabled');
$("#sending-indicator").hide();
send_status.hide();
if (respond_to_cursor) {
if (respond_to_cursor && narrow.narrowed_by_reply()) {
respond_to_message({trigger: 'autorespond'});
}
else {
respond_to_cursor = false;
}
},
error: function (xhr, error_type) {
if (error_type !== 'timeout' && reload.is_pending()) {