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>
pull/30473/head^2
Giteabot 7 months ago committed by GitHub
parent 3735797b33
commit dd12861011
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 8
      web_src/js/features/repo-issue.js

@ -435,12 +435,10 @@ export function initRepoPullRequestReview() {
offset += $('.diff-detail-box').outerHeight() + $(diffHeader).outerHeight(); offset += $('.diff-detail-box').outerHeight() + $(diffHeader).outerHeight();
} }
document.getElementById(`show-outdated-${id}`).classList.add('tw-hidden'); hideElem(`#show-outdated-${id}`);
document.getElementById(`code-comments-${id}`).classList.remove('tw-hidden'); showElem(`#code-comments-${id}, #code-preview-${id}, #hide-outdated-${id}`);
document.getElementById(`code-preview-${id}`).classList.remove('tw-hidden');
document.getElementById(`hide-outdated-${id}`).classList.remove('tw-hidden');
// if the comment box is folded, expand it // 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); setFileFolding(ancestorDiffBox, ancestorDiffBox.querySelector('.fold-file'), false);
} }

Loading…
Cancel
Save