Skip to content

Commit 943a449

Browse files
charles7668GiteaBot
authored andcommitted
Fix counter display number incorrectly displayed on the page (go-gitea#29448)
issue : go-gitea#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
1 parent b43ce53 commit 943a449

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

web_src/js/features/pull-view-file.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,11 @@ export function initViewedCheckboxListenerFor() {
4444
// Mark the file as viewed visually - will especially change the background
4545
if (this.checked) {
4646
form.classList.add(viewedStyleClass);
47+
checkbox.setAttribute('checked', '');
4748
prReview.numberOfViewedFiles++;
4849
} else {
4950
form.classList.remove(viewedStyleClass);
51+
checkbox.removeAttribute('checked');
5052
prReview.numberOfViewedFiles--;
5153
}
5254

0 commit comments

Comments
 (0)