aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/repo-code.js
diff options
context:
space:
mode:
authordelvh <leon@kske.dev>2022-05-07 20:28:10 +0200
committerGitHub <noreply@github.com>2022-05-07 20:28:10 +0200
commit5ca224a789394d00cc1efb5afcae7b87aa7d1e49 (patch)
treed88bddc7a08449a2c8f2b4e5ae47d3ef067a1cc0 /web_src/js/features/repo-code.js
parent59b30f060a840cde305952ef7bc344fa4101c0d5 (diff)
downloadgitea-5ca224a789394d00cc1efb5afcae7b87aa7d1e49.tar.gz
gitea-5ca224a789394d00cc1efb5afcae7b87aa7d1e49.zip
Allow to mark files in a PR as viewed (#19007)
Users can now mark files in PRs as viewed, resulting in them not being shown again by default when they reopen the PR again.
Diffstat (limited to 'web_src/js/features/repo-code.js')
-rw-r--r--web_src/js/features/repo-code.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/web_src/js/features/repo-code.js b/web_src/js/features/repo-code.js
index d7b4baac83..8562ba0072 100644
--- a/web_src/js/features/repo-code.js
+++ b/web_src/js/features/repo-code.js
@@ -1,5 +1,6 @@
import $ from 'jquery';
import {svg} from '../svg.js';
+import {invertFileFolding} from './file-fold.js';
function changeHash(hash) {
if (window.history.pushState) {
@@ -148,10 +149,7 @@ export function initRepoCodeView() {
}).trigger('hashchange');
}
$(document).on('click', '.fold-file', ({currentTarget}) => {
- const box = currentTarget.closest('.file-content');
- const folded = box.getAttribute('data-folded') !== 'true';
- currentTarget.innerHTML = svg(`octicon-chevron-${folded ? 'right' : 'down'}`, 18);
- box.setAttribute('data-folded', String(folded));
+ invertFileFolding(currentTarget.closest('.file-content'), currentTarget);
});
$(document).on('click', '.blob-excerpt', async ({currentTarget}) => {
const url = currentTarget.getAttribute('data-url');