소스 검색

Fix counter display number incorrectly displayed on the page (#29448) (#29478)

Backport #29448 by @charles7668

issue : #28239

The counter number script uses the 'checkbox' attribute to determine
whether an item is selected or not.

However, the input event only increments the counter value, and when
more items are displayed, it does not update all previously loaded
items.

As a result, the display becomes incorrect because it triggers the
update counter script, but checkboxes that are selected without the
'checked' attribute are not counted

Co-authored-by: charles <30816317+charles7668@users.noreply.github.com>
tags/v1.21.8
Giteabot 3 달 전
부모
커밋
5477728282
No account linked to committer's email address
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2
    0
      web_src/js/features/pull-view-file.js

+ 2
- 0
web_src/js/features/pull-view-file.js 파일 보기

@@ -44,9 +44,11 @@ export function initViewedCheckboxListenerFor() {
// Mark the file as viewed visually - will especially change the background
if (this.checked) {
form.classList.add(viewedStyleClass);
checkbox.setAttribute('checked', '');
prReview.numberOfViewedFiles++;
} else {
form.classList.remove(viewedStyleClass);
checkbox.removeAttribute('checked');
prReview.numberOfViewedFiles--;
}


Loading…
취소
저장