diff options
author | HEREYUA <37935145+HEREYUA@users.noreply.github.com> | 2024-03-21 11:38:27 +0100 |
---|---|---|
committer | Earl Warren <contact@earl-warren.org> | 2024-03-26 19:04:26 +0100 |
commit | 0f4614004eeff3dff3faf02d993f310dcbd1651d (patch) | |
tree | 59450b9156a5e5e8b9d20482d492635d293bba64 /web_src/js/features/repo-issue.js | |
parent | Fix JS error and improve error message styles (#29963) (diff) | |
download | forgejo-0f4614004eeff3dff3faf02d993f310dcbd1651d.tar.xz forgejo-0f4614004eeff3dff3faf02d993f310dcbd1651d.zip |
Solving the issue of UI disruption when the review is deleted without refreshing (#29951)
**After deleting the review and refreshing, the display is normal.
However, Without refreshing, the interface will be broken**
https://github.com/go-gitea/gitea/assets/37935145/f5cb19a6-eb26-47b0-b8ee-15b575bbe1ac
**after**
https://github.com/go-gitea/gitea/assets/37935145/aa65922c-2ebf-4fce-ad91-35661f70329a
(cherry picked from commit 0b4ff15356769db092fd7718da553e8a216c32fa)
Diffstat (limited to '')
-rw-r--r-- | web_src/js/features/repo-issue.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index bca062bcc7..ad2956a600 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -162,7 +162,8 @@ export function initRepoIssueCommentDelete() { const response = await POST($this.data('url')); if (!response.ok) throw new Error('Failed to delete comment'); const $conversationHolder = $this.closest('.conversation-holder'); - + const $parentTimelineItem = $this.closest('.timeline-item'); + const $parentTimelineGroup = $this.closest('.timeline-item-group'); // Check if this was a pending comment. if ($conversationHolder.find('.pending-label').length) { const $counter = $('#review-box .review-comments-counter'); @@ -185,6 +186,11 @@ export function initRepoIssueCommentDelete() { } $conversationHolder.remove(); } + // Check if there is no review content, move the time avatar upward to avoid overlapping the content below. + if (!$parentTimelineGroup.find('.timeline-item.comment').length && !$parentTimelineItem.find('.conversation-holder').length) { + const $timelineAvatar = $parentTimelineGroup.find('.timeline-avatar'); + $timelineAvatar.removeClass('timeline-avatar-offset'); + } } catch (error) { console.error(error); } |