Focus on the correct textbox when you initiate a compose when narrowed.

The logic for this already existed, but start() was getting called
twice, once from compose.set_mode and once from the click handler, and
the result was the focus always being in the stream input box.

(imported from commit 9a832a118856b5705524975a4412b7e6e547ef5c)
This commit is contained in:
Jessica McKellar 2013-05-25 22:56:55 -04:00
parent 1ac44f0356
commit c50e05bc68
1 changed files with 3 additions and 4 deletions

View File

@ -47,8 +47,7 @@ function show(tabname, focus_area) {
viewport.user_initiated_animate_scroll(cover+5); viewport.user_initiated_animate_scroll(cover+5);
} }
}); });
focus_area.focus(); focus_area.focus().select();
focus_area.select();
// Disable the notifications bar if it overlaps with the composebox // Disable the notifications bar if it overlaps with the composebox
notifications_bar.maybe_disable(); notifications_bar.maybe_disable();
} }
@ -556,9 +555,9 @@ $(function () {
// 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()) {
if (narrow.narrowed_to_pms()) { if (narrow.narrowed_to_pms()) {
compose.set_mode('private'); compose.start('private');
} else { } else {
compose.set_mode('stream'); compose.start('stream');
} }
e.stopPropagation(); e.stopPropagation();
} }