Always keep the compose box open after sending.

(Some cases are disabled on outside of staging still due to mix
protection concerns).

(imported from commit 26fcb95c055640ddd87c5df424990ebd865a336a)
This commit is contained in:
Jessica McKellar
2013-07-19 12:52:27 -04:00
parent f177147f7a
commit 12a37ed2b8
5 changed files with 2 additions and 10 deletions

View File

@@ -48,7 +48,7 @@ var globals =
+ ' mark_all_as_read message_unread process_read_messages unread_in_current_view' + ' mark_all_as_read message_unread process_read_messages unread_in_current_view'
+ ' fast_forward_pointer recent_subjects unread_subjects' + ' fast_forward_pointer recent_subjects unread_subjects'
+ ' add_message_metadata' + ' add_message_metadata'
+ ' respond_to_cursor respond_to_sent_message' + ' respond_to_cursor'
+ ' mark_message_as_read' + ' mark_message_as_read'
; ;

View File

@@ -269,7 +269,6 @@ exports.cancel = function () {
} }
$(document).trigger($.Event('compose_canceled.zephyr')); $(document).trigger($.Event('compose_canceled.zephyr'));
respond_to_cursor = false; respond_to_cursor = false;
respond_to_sent_message = false;
}; };
exports.empty_subject_placeholder = function () { exports.empty_subject_placeholder = function () {
@@ -387,7 +386,7 @@ function send_message() {
else { else {
respond_to_cursor = false; respond_to_cursor = false;
} }
if (respond_to_sent_message && page_params.staging) { if (page_params.staging) {
var new_msg = $.extend({replying_to_message: request}, request); var new_msg = $.extend({replying_to_message: request}, request);
new_msg.content = ""; new_msg.content = "";
compose.start(new_msg.type, new_msg); compose.start(new_msg.type, new_msg);
@@ -554,7 +553,6 @@ $(function () {
$("#new_message_content").focus(function (e) { $("#new_message_content").focus(function (e) {
// If we click in the composebox, start up a new message // If we click in the composebox, start up a new message
if (!compose.composing()) { if (!compose.composing()) {
respond_to_sent_message = true;
if (narrow.narrowed_to_pms()) { if (narrow.narrowed_to_pms()) {
compose.start('private'); compose.start('private');
} else { } else {
@@ -623,7 +621,6 @@ $(function () {
// Urgh, yet another hack to make sure we're "composing" // Urgh, yet another hack to make sure we're "composing"
// when text gets added into the composebox. // when text gets added into the composebox.
if (!compose.composing()) { if (!compose.composing()) {
respond_to_sent_message = true;
compose.start('stream'); compose.start('stream');
} }
if (i === -1) { if (i === -1) {
@@ -647,7 +644,6 @@ $(function () {
rawDrop: function (contents) { rawDrop: function (contents) {
var textbox = $("#new_message_content"); var textbox = $("#new_message_content");
if (!compose.composing()) { if (!compose.composing()) {
respond_to_sent_message = true;
compose.start('stream'); compose.start('stream');
} }
textbox.val(textbox.val() + contents); textbox.val(textbox.val() + contents);

View File

@@ -273,11 +273,9 @@ function process_hotkey(e) {
return true; return true;
case 'compose': // 'c': compose case 'compose': // 'c': compose
compose.start('stream'); compose.start('stream');
respond_to_sent_message = true;
return true; return true;
case 'compose_private_message': case 'compose_private_message':
compose.start('private'); compose.start('private');
respond_to_sent_message = true;
return true; return true;
case 'enter': // Enter: respond to message (unless we need to do something else) case 'enter': // Enter: respond to message (unless we need to do something else)
respond_to_cursor = true; respond_to_cursor = true;

View File

@@ -1158,7 +1158,6 @@ $(function () {
$('#user_presences').on('click', 'a', function (e) { $('#user_presences').on('click', 'a', function (e) {
var email = $(e.target).closest('a').attr('data-email'); var email = $(e.target).closest('a').attr('data-email');
narrow.by('pm-with', email, {trigger: 'presence list'}); narrow.by('pm-with', email, {trigger: 'presence list'});
respond_to_sent_message = true;
compose.start('private', {private_message_recipient: email, compose.start('private', {private_message_recipient: email,
trigger: 'presence list'}); trigger: 'presence list'});
// The preventDefault is necessary so that clicking the // The preventDefault is necessary so that clicking the

View File

@@ -10,7 +10,6 @@ var queued_mark_as_read = [];
var queued_flag_timer; var queued_flag_timer;
var respond_to_cursor = false; var respond_to_cursor = false;
var respond_to_sent_message = false;
var get_updates_params = { var get_updates_params = {
pointer: -1 pointer: -1