浏览代码

Solving the issue of UI disruption when the review is deleted without refreshing (#29951) (#29968)

backport #29951
tags/v1.21.9
HEREYUA 2 个月前
父节点
当前提交
3ff3c5ba78
没有帐户链接到提交者的电子邮件
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7
    1
      web_src/js/features/repo-issue.js

+ 7
- 1
web_src/js/features/repo-issue.js 查看文件

@@ -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');
@@ -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;

正在加载...
取消
保存