Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions extensions/BugModal/web/bug_modal.css
Original file line number Diff line number Diff line change
Expand Up @@ -1298,6 +1298,11 @@ a.comment-tag-url {
color: var(--secondary-button-foreground-color) !important;
}

.comment-reactions .sums button:disabled {
pointer-events: auto;
cursor: default;
}

.comment-reactions button[aria-pressed="true"] {
background-color: var(--selected-text-background-color) !important;
}
Expand Down
31 changes: 20 additions & 11 deletions extensions/BugModal/web/comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,10 @@ Bugzilla.BugModal.CommentReactions = class CommentReactions {
/** @type {string} */
this.anchorName = `--comment-${this.commentId}-reactions`;

// Users cannot react on old bugs
this.attachTooltipListeners();

// When reactions are disabled (no anchor button), tooltips are still
// available above but adding new reactions is not.
if (!this.$anchor) {
return;
}
Expand Down Expand Up @@ -609,19 +612,25 @@ Bugzilla.BugModal.CommentReactions = class CommentReactions {
$button.addEventListener('click', async () => {
this.toggleReaction($button);
});

if ($button.matches('.sum')) {
$button.addEventListener('mouseenter', () => {
this.updateButtons();
});

$button.addEventListener('focus', () => {
this.updateButtons();
});
}
});
}

/**
* Attach `mouseenter` and `focus` listeners on `.sum` buttons to fetch and display reaction
* tooltips. This is called for both active and disabled reaction states so that users can
* always see who reacted.
*/
attachTooltipListeners() {
const updateButtons = () => this.updateButtons();

this.buttons
.filter(($button) => $button.matches('.sum'))
.forEach(($button) => {
$button.addEventListener('mouseenter', updateButtons);
$button.addEventListener('focus', updateButtons);
});
}

/**
* All the emoji buttons.
*/
Expand Down
Loading