1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-14 14:37:20 +00:00

Fix line-number and scroll bugs (#33094) (#33095)

Partially backport #33094 

Fix the scroll bug in issue/pr view page.

Fix a JS error when line number exceeds the max
This commit is contained in:
wxiaoguang
2025-01-04 05:50:39 +08:00
committed by GitHub
parent e10d222434
commit fd281518ae
3 changed files with 7 additions and 18 deletions

View File

@ -59,7 +59,7 @@ function selectRange($linesEls, $selectionEndEl, $selectionStartEls?) {
copyPermalink.setAttribute('data-url', link);
};
if ($selectionStartEls) {
if ($selectionStartEls && $selectionStartEls[0]) {
let a = parseInt($selectionEndEl[0].getAttribute('rel').slice(1));
let b = parseInt($selectionStartEls[0].getAttribute('rel').slice(1));
let c;