Skip to content

Commit

Permalink
Fix show more for image on diff page (#25672) (#25673)
Browse files Browse the repository at this point in the history
Backport #25672 by @HesterG

Right now when clicking on loadmore on files change page, if the loaded
content is image, it will be always in load status:


https://github.com/go-gitea/gitea/assets/17645053/39e449b6-067a-474c-9443-9dd98d5bbfe2

This PR fixes this by adding `initImageDiff ` to `onShowMoreFiles `

After:


https://github.com/go-gitea/gitea/assets/17645053/87bbb13e-0064-4a6e-a7ad-0f0060eb8bff

Co-authored-by: HesterG <[email protected]>
  • Loading branch information
GiteaBot and HesterG authored Jul 4, 2023
1 parent 0af6542 commit 1f90376
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions web_src/js/features/repo-diff.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {initRepoIssueContentHistory} from './repo-issue-content.js';
import {initDiffFileTree} from './repo-diff-filetree.js';
import {validateTextareaNonEmpty} from './comp/ComboMarkdownEditor.js';
import {initViewedCheckboxListenerFor, countAndUpdateViewedFiles, initExpandAndCollapseFilesButton} from './pull-view-file.js';
import {initImageDiff} from './imagediff.js';

const {csrfToken, pageData} = window.config;

Expand Down Expand Up @@ -117,6 +118,7 @@ function onShowMoreFiles() {
initRepoIssueContentHistory();
initViewedCheckboxListenerFor();
countAndUpdateViewedFiles();
initImageDiff();
}

export function loadMoreFiles(url) {
Expand Down

0 comments on commit 1f90376

Please sign in to comment.