1
0
Fork 0
forked from forgejo/forgejo

Forbid variables containing jQuery collections not having the $ prefix (#29839)

See
https://github.com/wikimedia/eslint-plugin-no-jquery/blob/master/docs/rules/variable-pattern.md

---------

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
(cherry picked from commit 3cd64949ae1402a4ff45fba0a27c4acca1c5aead)
This commit is contained in:
Yarden Shoham 2024-03-16 14:22:16 +02:00 committed by Earl Warren
parent 96e5d38b55
commit d5f44c2499
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
14 changed files with 192 additions and 192 deletions

View file

@ -17,21 +17,21 @@ export function initCompReactionSelector($parent) {
const data = await res.json();
if (data && (data.html || data.empty)) {
const content = $(this).closest('.content');
let react = content.find('.segment.reactions');
if ((!data.empty || data.html === '') && react.length > 0) {
react.remove();
const $content = $(this).closest('.content');
let $react = $content.find('.segment.reactions');
if ((!data.empty || data.html === '') && $react.length > 0) {
$react.remove();
}
if (!data.empty) {
const attachments = content.find('.segment.bottom:first');
react = $(data.html);
if (attachments.length > 0) {
react.insertBefore(attachments);
const $attachments = $content.find('.segment.bottom:first');
$react = $(data.html);
if ($attachments.length > 0) {
$react.insertBefore($attachments);
} else {
react.appendTo(content);
$react.appendTo($content);
}
react.find('.dropdown').dropdown();
initCompReactionSelector(react);
$react.find('.dropdown').dropdown();
initCompReactionSelector($react);
}
}
});