From 0dbc5df42dfa526c477c9eac9ede3f8fa4ca9985 Mon Sep 17 00:00:00 2001 From: Gittenburg Date: Tue, 11 Aug 2020 11:05:59 +0200 Subject: [PATCH] message_edit_form: Make edit controls accessible. Fixes #6234. --- static/js/hotkey.js | 10 +++++----- static/templates/message_edit_form.hbs | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/static/js/hotkey.js b/static/js/hotkey.js index a3a0ade230..7abbf08d97 100644 --- a/static/js/hotkey.js +++ b/static/js/hotkey.js @@ -330,6 +330,11 @@ exports.process_enter_key = function (e) { return true; } + if ($(e.target).attr("role") === "button") { + e.target.click(); + return false; + } + // If we're on a button or a link and have pressed Enter, let the // browser handle the keypress // @@ -342,11 +347,6 @@ exports.process_enter_key = function (e) { return false; } - if ($(e.target).attr("role") === "button") { - e.target.click(); - return false; - } - if ($("#preview_message_area").is(":visible")) { compose.enter_with_preview_open(); return true; diff --git a/static/templates/message_edit_form.hbs b/static/templates/message_edit_form.hbs index 7a56998f37..5303378c70 100644 --- a/static/templates/message_edit_form.hbs +++ b/static/templates/message_edit_form.hbs @@ -62,16 +62,16 @@ {{#if is_content_editable}}
- - + + {{#if file_upload_enabled}} - + {{/if}} {{#if show_video_chat_button}} - + {{/if}} - - + +
{{/if}} {{else}}