Skip to content

Commit

Permalink
Solving the issue of UI disruption when the review is deleted without…
Browse files Browse the repository at this point in the history
… refreshing (go-gitea#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
  • Loading branch information
HEREYUA committed Mar 21, 2024
1 parent 58a0ba7 commit be8c2c0
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion web_src/js/features/repo-issue.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ export function initRepoIssueCommentDelete() {
_csrf: csrfToken,
}).done(() => {
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');
Expand All @@ -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');
}
});
}
return false;
Expand Down

0 comments on commit be8c2c0

Please sign in to comment.