From e80d1f4ad0e2e134d25e257c4683cd94ee46d1e2 Mon Sep 17 00:00:00 2001 From: Kevin Mehall Date: Thu, 13 Jun 2013 17:48:55 -0400 Subject: [PATCH] Another try at fixing tabbing into the compose box, Trac #1245. Hopefully this time with fewer stack overflows. It sets the flag that will break the cycle *before* triggering another focus event. (imported from commit 5e3ed74f1eeab8a18e36525ae7c8f1f1c756eb58) --- zephyr/static/js/compose.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/zephyr/static/js/compose.js b/zephyr/static/js/compose.js index 78b7fdef90..40399f0852 100644 --- a/zephyr/static/js/compose.js +++ b/zephyr/static/js/compose.js @@ -206,6 +206,8 @@ exports.start = function (msg_type, opts) { focus_area = 'new_message_content'; } + is_composing_message = msg_type; + if (msg_type === 'stream') { show('stream', $("#" + (focus_area || 'stream'))); } else { @@ -216,7 +218,6 @@ exports.start = function (msg_type, opts) { do_fade(opts.replying_to_message, msg_type); } - is_composing_message = msg_type; exports.decorate_stream_bar(opts.stream); $(document).trigger($.Event('compose_started.zephyr', opts)); }; @@ -566,7 +567,7 @@ exports.validate = function () { $(function () { $("#new_message_content").autosize(); - $("#new_message_content").click(function (e) { + $("#new_message_content").focus(function (e) { // If we click in the composebox, start up a new message if (!compose.composing()) { respond_to_sent_message = true;