giphy: Convert `compose_giphy_logo` from id to class.

Since there are multiple `compose_giphy_logo` elements, we should
use it as a class as per HTML spec.
This commit is contained in:
Aman Agrawal 2021-04-06 11:34:33 +00:00 committed by Tim Abbott
parent a2140eb9b5
commit d4fa938a23
3 changed files with 4 additions and 4 deletions

View File

@ -650,7 +650,7 @@ export function initialize() {
function handle_compose_click(e) {
// Emoji clicks should be handled by their own click handler in emoji_picker.js
if ($(e.target).is("#emoji_map, img.emoji, .drag, #compose_giphy_logo")) {
if ($(e.target).is("#emoji_map, img.emoji, .drag, .compose_giphy_logo")) {
return;
}

View File

@ -101,9 +101,9 @@ function update_grid_with_search_term() {
export function initialize() {
$("body").on("keydown", ".giphy-gif", ui_util.convert_enter_to_click);
$("body").on("keydown", "#compose_giphy_logo", ui_util.convert_enter_to_click);
$("body").on("keydown", ".compose_giphy_logo", ui_util.convert_enter_to_click);
$("body").on("click", "#compose_giphy_logo", (e) => {
$("body").on("click", ".compose_giphy_logo", (e) => {
e.preventDefault();
e.stopPropagation();

View File

@ -103,7 +103,7 @@
<a role="button" class="message-control-button fa fa-smile-o" aria-label="{{_('Add emoji')}}" id="emoji_map" tabindex=0 title="{{ _('Add emoji') }}"></a>
{% if giphy_api_available %}
<a role="button" class="message-control-button" aria-label="{{_('Add GIF')}}" id="compose_box_giphy_grid" title="{{ _('Add GIF') }}">
<img id="compose_giphy_logo" tabindex=0 src="/static/images/GIPHY_logo.png">
<img class="compose_giphy_logo" tabindex=0 src="/static/images/GIPHY_logo.png">
</a>
{% endif %}
<a class="message-control-link drafts-link" href="#drafts" title="{{ _('Drafts') }} (d)">{{ _('Drafts') }}</a>