aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGiteabot <teabot@gitea.io>2024-04-14 18:46:21 +0800
committerGitHub <noreply@github.com>2024-04-14 18:46:21 +0800
commitdd128610115c62c96bd1f9df09aae32603c17c17 (patch)
treede686667b97798293610875c85c4942a2537675a
parent3735797b3366c983de5b199a50f4c1015e8cb807 (diff)
downloadgitea-dd128610115c62c96bd1f9df09aae32603c17c17.tar.gz
gitea-dd128610115c62c96bd1f9df09aae32603c17c17.zip
Fix JS error when opening to expanded code comment (#30463) (#30470)
Backport #30463 by silverwind Co-authored-by: silverwind <me@silverwind.io> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
-rw-r--r--web_src/js/features/repo-issue.js8
1 files changed, 3 insertions, 5 deletions
diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js
index bb45c6ae57..1438caeb60 100644
--- a/web_src/js/features/repo-issue.js
+++ b/web_src/js/features/repo-issue.js
@@ -435,12 +435,10 @@ export function initRepoPullRequestReview() {
offset += $('.diff-detail-box').outerHeight() + $(diffHeader).outerHeight();
}
- document.getElementById(`show-outdated-${id}`).classList.add('tw-hidden');
- document.getElementById(`code-comments-${id}`).classList.remove('tw-hidden');
- document.getElementById(`code-preview-${id}`).classList.remove('tw-hidden');
- document.getElementById(`hide-outdated-${id}`).classList.remove('tw-hidden');
+ hideElem(`#show-outdated-${id}`);
+ showElem(`#code-comments-${id}, #code-preview-${id}, #hide-outdated-${id}`);
// if the comment box is folded, expand it
- if (ancestorDiffBox.getAttribute('data-folded') === 'true') {
+ if (ancestorDiffBox?.getAttribute('data-folded') === 'true') {
setFileFolding(ancestorDiffBox, ancestorDiffBox.querySelector('.fold-file'), false);
}