From d548b71d5286871e1b59ce115ec4a69c9865329b Mon Sep 17 00:00:00 2001 From: HEREYUA <1240335630@qq.com> Date: Thu, 21 Mar 2024 10:08:40 +0800 Subject: [PATCH 1/5] fix --- web_src/js/features/repo-issue.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index bca062bcc7d35..259f730b3c2ac 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,13 @@ export function initRepoIssueCommentDelete() { } $conversationHolder.remove(); } + // Check if there is no review content, move the avatar upward to avoid blocking the content below. + if (!$parentTimelineItem.find('.conversation-holder').length) { + const $timelineAvatar = $parentTimelineGroup.find('.timeline-avatar').eq(0); + if ($timelineAvatar.hasClass('timeline-avatar-offset')) { + $timelineAvatar.removeClass('timeline-avatar-offset'); + } + } } catch (error) { console.error(error); } From 631a8b074a73e497e3dbf8406284239d14e1f396 Mon Sep 17 00:00:00 2001 From: HEREYUA <1240335630@qq.com> Date: Thu, 21 Mar 2024 10:41:57 +0800 Subject: [PATCH 2/5] fix --- web_src/js/features/repo-issue.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 259f730b3c2ac..86f8df4774389 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -186,12 +186,10 @@ export function initRepoIssueCommentDelete() { } $conversationHolder.remove(); } - // Check if there is no review content, move the avatar upward to avoid blocking the content below. + // Check if there is no review content, move the time avatar upward to avoid overlapping the content below. if (!$parentTimelineItem.find('.conversation-holder').length) { - const $timelineAvatar = $parentTimelineGroup.find('.timeline-avatar').eq(0); - if ($timelineAvatar.hasClass('timeline-avatar-offset')) { - $timelineAvatar.removeClass('timeline-avatar-offset'); - } + const $timelineAvatar = $parentTimelineGroup.find('.timeline-avatar'); + $timelineAvatar.removeClass('timeline-avatar-offset'); } } catch (error) { console.error(error); From 37e1fe6c36378d0a603804b4eb5ac3a0270bb0ae Mon Sep 17 00:00:00 2001 From: HEREYUA <1240335630@qq.com> Date: Thu, 21 Mar 2024 11:19:53 +0800 Subject: [PATCH 3/5] fix --- web_src/js/features/repo-issue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 86f8df4774389..3def0a3954b21 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -187,7 +187,7 @@ export function initRepoIssueCommentDelete() { $conversationHolder.remove(); } // Check if there is no review content, move the time avatar upward to avoid overlapping the content below. - if (!$parentTimelineItem.find('.conversation-holder').length) { + if (!$parentTimelineGroup.find('.comment').length && !$parentTimelineItem.find('.conversation-holder').length) { const $timelineAvatar = $parentTimelineGroup.find('.timeline-avatar'); $timelineAvatar.removeClass('timeline-avatar-offset'); } From fd6f4c0a03dc21c4d81f40d6cc8b3bdba8a647eb Mon Sep 17 00:00:00 2001 From: HEREYUA <1240335630@qq.com> Date: Thu, 21 Mar 2024 11:28:32 +0800 Subject: [PATCH 4/5] fix --- web_src/js/features/repo-issue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 3def0a3954b21..190004142c215 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -187,7 +187,7 @@ 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('.comment').length && !$parentTimelineItem.find('.conversation-holder').length) { + if (!$parentTimelineGroup.find('.timeline-item .comment').length && !$parentTimelineItem.find('.conversation-holder').length) { const $timelineAvatar = $parentTimelineGroup.find('.timeline-avatar'); $timelineAvatar.removeClass('timeline-avatar-offset'); } From f21c8469f34d6e9dd7635b91d22b4dbd46eee8d6 Mon Sep 17 00:00:00 2001 From: HEREYUA <1240335630@qq.com> Date: Thu, 21 Mar 2024 11:31:30 +0800 Subject: [PATCH 5/5] fix --- web_src/js/features/repo-issue.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js index 190004142c215..ad2956a600264 100644 --- a/web_src/js/features/repo-issue.js +++ b/web_src/js/features/repo-issue.js @@ -187,7 +187,7 @@ 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) { + if (!$parentTimelineGroup.find('.timeline-item.comment').length && !$parentTimelineItem.find('.conversation-holder').length) { const $timelineAvatar = $parentTimelineGroup.find('.timeline-avatar'); $timelineAvatar.removeClass('timeline-avatar-offset'); }