Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

message feed: Make message controls more accessible.

Gittenburg4cd23103db21
diff --git a/static/js/hotkey.js b/static/js/hotkey.js
index 07cd016f7d6..528bf4663fd 100644
--- a/static/js/hotkey.js
+++ b/static/js/hotkey.js
@@ -340,6 +340,11 @@ 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/styles/zulip.scss b/static/styles/zulip.scss
index 83534747bc4..c0ccfafff78 100644
--- a/static/styles/zulip.scss
+++ b/static/styles/zulip.scss
@@ -763,7 +763,8 @@ td.pointer {
vertical-align: top;
border: none;
- &:hover .message_controls {
+ &:hover .message_controls,
+ &:focus-within .message_controls {
.empty-star {
opacity: 0.4;
}
diff --git a/static/templates/edit_content_button.hbs b/static/templates/edit_content_button.hbs
index b9bd15642a8..1d2409de682 100644
--- a/static/templates/edit_content_button.hbs
+++ b/static/templates/edit_content_button.hbs
@@ -1,5 +1,5 @@
{{#if is_editable}}
-<i class="fa fa-pencil edit_content_button" aria-hidden="true" title="{{t "Edit" }} (e)"></i>
+<i class="fa fa-pencil edit_content_button" role="button" tabindex="0" aria-label="{{t "Edit" }} (e)" title="{{t "Edit" }} (e)"></i>
{{else}}
-<i class="fa fa-file-code-o edit_content_button" aria-hidden="true" title="{{t "View source" }} (e)" data-message-id="{{msg_id}}"></i>
+<i class="fa fa-file-code-o edit_content_button" role="button" tabindex="0" aria-label="{{t "View source" }} (e)" title="{{t "View source" }} (e)" data-message-id="{{msg_id}}"></i>
{{/if}}
diff --git a/static/templates/message_controls.hbs b/static/templates/message_controls.hbs
index ecef0319adc..1a2ede3f7fb 100644
--- a/static/templates/message_controls.hbs
+++ b/static/templates/message_controls.hbs
@@ -19,12 +19,12 @@
<div class="message_failed {{#unless msg.failed_request}}notvisible{{/unless}}">
<i class="fa fa-refresh refresh-failed-message" data-toggle="tooltip" title="{{t 'Retry' }}" aria-label="{{t 'Retry' }}" role="button" tabindex="0"></i>
- <i class="fa fa-times-circle remove-failed-message" aria-hidden="true" data-toggle="tooltip" title="{{t 'Cancel' }}"></i>
+ <i class="fa fa-times-circle remove-failed-message" data-toggle="tooltip" title="{{t 'Cancel' }}" aria-label="{{t 'Cancel' }}" role="button" tabindex="0"></i>
</div>
{{#unless msg/locally_echoed}}
<div class="star_container {{#if msg/starred}}{{else}}empty-star{{/if}}">
- <i class="star fa {{#if msg/starred}}fa-star{{else}}fa-star-o{{/if}}" title="{{#tr this.msg}}__starred_status__ this message{{/tr}} (*)"></i>
+ <i role="button" tabindex="0" class="star fa {{#if msg/starred}}fa-star{{else}}fa-star-o{{/if}}" title="{{#tr this.msg}}__starred_status__ this message{{/tr}} (*)"></i>
</div>
{{/unless}}