fix: only display "Viewed" checkbox if fileContentToggle is set

This commit is contained in:
Pierric Cistac 2021-03-01 17:13:44 -05:00
parent f046d183df
commit 7668889493
No known key found for this signature in database
GPG key ID: 9D98B3AF93C7362D
2 changed files with 4 additions and 2 deletions

View file

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

View file

@ -112,7 +112,9 @@ export class Diff2HtmlUI {
}
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 fileContents: HTMLElement | null | undefined = fileContentToggleBtn
.closest('.d2h-file-wrapper')