Merge pull request #366 from huggingface/fix-viewed-checkbox

fix: only display "Viewed" checkbox if `fileContentToggle` is set
This commit is contained in:
Rodrigo Fernandes 2021-03-04 22:40:24 +00:00 committed by GitHub
commit e55d145036
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View file

@ -74,7 +74,7 @@
.d2h-file-collapse { .d2h-file-collapse {
justify-content: flex-end; justify-content: flex-end;
display: flex; display: none;
cursor: pointer; cursor: pointer;
font-size: 12px; font-size: 12px;
align-items: center; align-items: center;

View file

@ -112,7 +112,9 @@ export class Diff2HtmlUI {
} }
fileContentToggle(): void { fileContentToggle(): void {
this.targetElement.querySelectorAll('.d2h-file-collapse').forEach(fileContentToggleBtn => { this.targetElement.querySelectorAll<HTMLElement>('.d2h-file-collapse').forEach(fileContentToggleBtn => {
fileContentToggleBtn.style.display = 'flex';
const toggleFileContents: (selector: string) => void = selector => { const toggleFileContents: (selector: string) => void = selector => {
const fileContents: HTMLElement | null | undefined = fileContentToggleBtn const fileContents: HTMLElement | null | undefined = fileContentToggleBtn
.closest('.d2h-file-wrapper') .closest('.d2h-file-wrapper')