Add compose_actions.cancel() shim.

This commit is contained in:
Steve Howell 2017-03-18 09:55:11 -07:00 committed by Tim Abbott
parent faa9446e64
commit 59fd9e4d48
4 changed files with 9 additions and 8 deletions

View File

@ -354,7 +354,7 @@ $(function () {
$(".compose-content").click(handle_compose_click);
$("#compose_close").click(function () {
compose.cancel();
compose_actions.cancel();
});
$("#join_unsub_stream").click(function (e) {
@ -564,7 +564,7 @@ $(function () {
($(e.target).closest(".modal").length === 0) &&
window.getSelection().toString() === "" &&
($(e.target).closest('#emoji_map').length === 0)) {
compose.cancel();
compose_actions.cancel();
}
});

View File

@ -219,7 +219,7 @@ exports.process_escape_key = function (e) {
if (compose.composing()) {
// If the user hit the escape key, cancel the current compose
compose.cancel();
compose_actions.cancel();
return true;
}
@ -236,7 +236,7 @@ exports.process_escape_key = function (e) {
}
if (compose.composing()) {
compose.cancel();
compose_actions.cancel();
return true;
}
@ -447,13 +447,13 @@ exports.process_hotkey = function (e, hotkey) {
// we handle this in other functions.
if (event_name === 'left_arrow' && focus_in_empty_compose()) {
compose.cancel();
compose_actions.cancel();
message_edit.edit_last_sent_message();
return true;
}
if ((event_name === 'up_arrow' || event_name === 'down_arrow') && focus_in_empty_compose()) {
compose.cancel();
compose_actions.cancel();
// don't return, as we still want it to be picked up by the code below
} else if (event_name === "page_up") {
$("#new_message_content").caret(0);

View File

@ -194,7 +194,7 @@ exports.activate = function (raw_operators, opts) {
var had_message_content = compose.has_message_content();
if (!had_message_content) {
compose.cancel();
compose_actions.cancel();
} else {
compose_fade.update_message_list();
}
@ -454,7 +454,7 @@ exports.deactivate = function () {
}
if (!compose.has_message_content()) {
compose.cancel();
compose_actions.cancel();
}
current_filter = undefined;

View File

@ -11,3 +11,4 @@ narrow_state.set_compose_defaults = narrow.set_compose_defaults;
var compose_actions = {};
compose_actions.start = compose.start;
compose_actions.cancel = compose.cancel;