From d6a21fcb79fa5d5afda42bb44435eb303712d467 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Sat, 30 Mar 2024 12:40:39 +0300 Subject: [PATCH] [PORT] Remove jQuery class from the comment context menu (gitea #30179) - Switched from jQuery class functions to plain JavaScript - Tested the comment context menu functionality and it works as before Signed-off-by: Yarden Shoham Co-authored-by: silverwind --- Resolves #5016 (cherry picked from commit 66f7d47d2c702bab4ca9bcedc1c0ba9ddfa49a17) --- web_src/js/modules/fomantic/dropdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/modules/fomantic/dropdown.js b/web_src/js/modules/fomantic/dropdown.js index e795e8e2c8..82e710860d 100644 --- a/web_src/js/modules/fomantic/dropdown.js +++ b/web_src/js/modules/fomantic/dropdown.js @@ -207,7 +207,7 @@ function attachDomEvents(dropdown, focusable, menu) { if (!$item) $item = $(menu).find('> .item.selected'); // when dropdown filters items by input, there is no "value", so query the "selected" item // if the selected item is clickable, then trigger the click event. // we can not click any item without check, because Fomantic code might also handle the Enter event. that would result in double click. - if ($item && ($item[0].matches('a') || $item.hasClass('js-aria-clickable'))) $item[0].click(); + if ($item?.[0]?.matches('a, .js-aria-clickable')) $item[0].click(); } });