loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Remove jQuery `.attr` from the reaction selector (#30052)

- Switched from jQuery `attr` to plain javascript `getAttribute`
- Tested the reaction selector and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
(cherry picked from commit 2e31a2800e1112ee0ab5a8d3c66b0fba2e737870)

authored by

Yarden Shoham and committed by
Earl Warren
8e3e31a5 8557c6ae

+3 -3
+3 -3
web_src/js/features/comp/ReactionSelector.js
··· 7 7 8 8 if ($(this).hasClass('disabled')) return; 9 9 10 - const actionUrl = $(this).closest('[data-action-url]').attr('data-action-url'); 11 - const reactionContent = $(this).attr('data-reaction-content'); 12 - const hasReacted = $(this).closest('.ui.segment.reactions').find(`a[data-reaction-content="${reactionContent}"]`).attr('data-has-reacted') === 'true'; 10 + const actionUrl = this.closest('[data-action-url]')?.getAttribute('data-action-url'); 11 + const reactionContent = this.getAttribute('data-reaction-content'); 12 + const hasReacted = this.closest('.ui.segment.reactions')?.querySelector(`a[data-reaction-content="${reactionContent}"]`)?.getAttribute('data-has-reacted') === 'true'; 13 13 14 14 const res = await POST(`${actionUrl}/${hasReacted ? 'unreact' : 'react'}`, { 15 15 data: new URLSearchParams({content: reactionContent}),