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 class from the code range selection (#30173)

- Switched from jQuery class functions to plain JavaScript `classList`
- Tested the code range selection functionality and it works as before

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

authored by

Yarden Shoham and committed by
Gergely Nagy
811c14b8 e08f05b0

+5 -3
+5 -3
web_src/js/features/repo-code.js
··· 25 25 } 26 26 27 27 function selectRange($linesEls, $selectionEndEl, $selectionStartEls) { 28 - $linesEls.closest('tr').removeClass('active'); 28 + for (const el of $linesEls) { 29 + el.closest('tr').classList.remove('active'); 30 + } 29 31 30 32 // add hashchange to permalink 31 33 const refInNewIssue = document.querySelector('a.ref-in-new-issue'); ··· 72 74 classes.push(`[rel=L${i}]`); 73 75 } 74 76 $linesEls.filter(classes.join(',')).each(function () { 75 - $(this).closest('tr').addClass('active'); 77 + this.closest('tr').classList.add('active'); 76 78 }); 77 79 changeHash(`#L${a}-L${b}`); 78 80 ··· 82 84 return; 83 85 } 84 86 } 85 - $selectionEndEl.closest('tr').addClass('active'); 87 + $selectionEndEl[0].closest('tr').classList.add('active'); 86 88 changeHash(`#${$selectionEndEl[0].getAttribute('rel')}`); 87 89 88 90 updateIssueHref($selectionEndEl[0].getAttribute('rel'));