message_edit: Fix tab navigation to "Close" button.

This adds a line to static/js/hotkey.js for focusing the "Close"
button.  Tweaked by tabbott to make more clear that we don't expect
there to ever be both a close button and a save button, since in that
case this code would be busted.

Fixes: #3830.
This commit is contained in:
Amadeo234 2018-12-09 15:48:40 +01:00 committed by Tim Abbott
parent 7d12e2019d
commit 38aa44ef31
1 changed files with 2 additions and 1 deletions

View File

@ -385,7 +385,8 @@ exports.process_tab_key = function () {
var focused_message_edit_content = $(".message_edit_content").filter(":focus");
if (focused_message_edit_content.length > 0) {
message_edit_form = focused_message_edit_content.closest(".message_edit_form");
message_edit_form.find(".message_edit_save").focus();
// Open message edit forms either have a save button or a close button, but not both.
message_edit_form.find(".message_edit_save,.message_edit_close").focus();
return true;
}