Fix a UI error when folding a file content in a commit view (#17446)

This commit is contained in:
wxiaoguang 2021-10-27 19:11:56 +08:00 committed by GitHub
parent a462fcaac8
commit 89beceeb9a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 3 deletions

View file

@ -131,9 +131,8 @@ export function initRepoCodeView() {
}
$(document).on('click', '.fold-file', ({currentTarget}) => {
const box = currentTarget.closest('.file-content');
const chevron = currentTarget.querySelector('a.chevron');
const folded = box.dataset.folded !== 'true';
chevron.innerHTML = svg(`octicon-chevron-${folded ? 'right' : 'down'}`, 18);
currentTarget.innerHTML = svg(`octicon-chevron-${folded ? 'right' : 'down'}`, 18);
box.dataset.folded = String(folded);
});
$(document).on('click', '.blob-excerpt', async ({currentTarget}) => {