Add compose_state.has_message_content() shim.

This commit is contained in:
Steve Howell 2017-03-18 10:10:37 -07:00 committed by Tim Abbott
parent 59fd9e4d48
commit d75efa19db
4 changed files with 7 additions and 3 deletions

View File

@ -35,6 +35,7 @@
"typing": false, "typing": false,
"compose": false, "compose": false,
"compose_actions": false, "compose_actions": false,
"compose_state": false,
"compose_fade": false, "compose_fade": false,
"modals": false, "modals": false,
"subs": false, "subs": false,

View File

@ -191,7 +191,7 @@ exports.activate = function (raw_operators, opts) {
trigger: opts ? opts.trigger : undefined, trigger: opts ? opts.trigger : undefined,
previous_id: current_msg_list.selected_id()}); previous_id: current_msg_list.selected_id()});
var had_message_content = compose.has_message_content(); var had_message_content = compose_state.has_message_content();
if (!had_message_content) { if (!had_message_content) {
compose_actions.cancel(); compose_actions.cancel();
@ -453,7 +453,7 @@ exports.deactivate = function () {
return; return;
} }
if (!compose.has_message_content()) { if (!compose_state.has_message_content()) {
compose_actions.cancel(); compose_actions.cancel();
} }

View File

@ -12,3 +12,6 @@ narrow_state.set_compose_defaults = narrow.set_compose_defaults;
var compose_actions = {}; var compose_actions = {};
compose_actions.start = compose.start; compose_actions.start = compose.start;
compose_actions.cancel = compose.cancel; compose_actions.cancel = compose.cancel;
var compose_state = {};
compose_state.has_message_content = compose.has_message_content;

View File

@ -36,7 +36,7 @@ function send_typing_notification_ajax(recipients, operation) {
function check_and_send(operation) { function check_and_send(operation) {
var compose_recipient = compose.recipient(); var compose_recipient = compose.recipient();
var compose_nonempty = compose.has_message_content(); var compose_nonempty = compose_state.has_message_content();
// If we currently have an active typing notification out, and we // If we currently have an active typing notification out, and we
// want to send a stop notice, or the compose recipient changed // want to send a stop notice, or the compose recipient changed