Remove jQuery class from the reaction selector (#30138)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the reaction selector and it works as before

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
Yarden Shoham 2024-03-27 18:09:34 +02:00 committed by GitHub
parent 34acd8e376
commit 1a71dbfb78
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,7 @@ export function initCompReactionSelector($parent) {
$parent.find(`.select-reaction .item.reaction, .comment-reaction-button`).on('click', async function (e) { $parent.find(`.select-reaction .item.reaction, .comment-reaction-button`).on('click', async function (e) {
e.preventDefault(); e.preventDefault();
if ($(this).hasClass('disabled')) return; if (this.classList.contains('disabled')) return;
const actionUrl = this.closest('[data-action-url]')?.getAttribute('data-action-url'); const actionUrl = this.closest('[data-action-url]')?.getAttribute('data-action-url');
const reactionContent = this.getAttribute('data-reaction-content'); const reactionContent = this.getAttribute('data-reaction-content');