mirror of https://github.com/go-gitea/gitea.git
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
This commit is contained in:
parent
1a4f693f9f
commit
0b4ff15356
|
@ -162,7 +162,8 @@ export function initRepoIssueCommentDelete() {
|
||||||
const response = await POST($this.data('url'));
|
const response = await POST($this.data('url'));
|
||||||
if (!response.ok) throw new Error('Failed to delete comment');
|
if (!response.ok) throw new Error('Failed to delete comment');
|
||||||
const $conversationHolder = $this.closest('.conversation-holder');
|
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.
|
// Check if this was a pending comment.
|
||||||
if ($conversationHolder.find('.pending-label').length) {
|
if ($conversationHolder.find('.pending-label').length) {
|
||||||
const $counter = $('#review-box .review-comments-counter');
|
const $counter = $('#review-box .review-comments-counter');
|
||||||
|
@ -185,6 +186,11 @@ export function initRepoIssueCommentDelete() {
|
||||||
}
|
}
|
||||||
$conversationHolder.remove();
|
$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) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue