mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-07-13 04:58:46 +00:00
fix(ui): allow dragging up for a multi-line comment (#13296)
Close #13287 Remove the limitation that only allow dragging down Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/13296 Reviewed-by: Mathieu Fenniak <mfenniak@noreply.codeberg.org>
This commit is contained in:
parent
c1351e62d4
commit
f4cdb8bd19
1 changed files with 6 additions and 5 deletions
|
|
@ -594,14 +594,15 @@ export function initRepoPullRequestReview() {
|
|||
const filePath = this.closest('[data-path]')?.getAttribute('data-path');
|
||||
if (filePath !== multiLineDrag.path) return;
|
||||
|
||||
// Only extend downward (end >= start)
|
||||
if (lineNum < multiLineDrag.startIdx) return;
|
||||
|
||||
multiLineDrag.currentIdx = lineNum;
|
||||
|
||||
// Update highlight
|
||||
// Update highlight; the drag can go both ways, highlightLineRange needs ordered bounds
|
||||
clearMultiLineSelection();
|
||||
highlightLineRange(multiLineDrag.path, multiLineDrag.side, multiLineDrag.startIdx, multiLineDrag.currentIdx);
|
||||
highlightLineRange(
|
||||
multiLineDrag.path, multiLineDrag.side,
|
||||
Math.min(multiLineDrag.startIdx, multiLineDrag.currentIdx),
|
||||
Math.max(multiLineDrag.startIdx, multiLineDrag.currentIdx),
|
||||
);
|
||||
});
|
||||
|
||||
// Mouseup: finalize multi-line selection
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue