Fix JS error when reply comment on Conversation page (#32685)
Fix #32684, regression of #32596 (side-effect of jQuery removal: jQuery could tolerate non-existing elements) And fix another regression bug from #30453 (initCompReactionSelector double-init)
This commit is contained in:
parent
2abef971dc
commit
1bb1a51f47
2 changed files with 19 additions and 13 deletions
|
@ -1,8 +1,8 @@
|
|||
import {POST} from '../../modules/fetch.ts';
|
||||
import {fomanticQuery} from '../../modules/fomantic/base.ts';
|
||||
|
||||
export function initCompReactionSelector() {
|
||||
for (const container of document.querySelectorAll('.issue-content, .diff-file-body')) {
|
||||
export function initCompReactionSelector(parent: ParentNode = document) {
|
||||
for (const container of parent.querySelectorAll('.issue-content, .diff-file-body')) {
|
||||
container.addEventListener('click', async (e) => {
|
||||
// there are 2 places for the "reaction" buttons, one is the top-right reaction menu, one is the bottom of the comment
|
||||
const target = e.target.closest('.comment-reaction-button');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue