From 76688894936de0f0da75e73feb35e3d94f3b2b9d Mon Sep 17 00:00:00 2001 From: Pierric Cistac Date: Mon, 1 Mar 2021 17:13:44 -0500 Subject: [PATCH] fix: only display "Viewed" checkbox if `fileContentToggle` is set --- src/ui/css/diff2html.css | 2 +- src/ui/js/diff2html-ui-base.ts | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/ui/css/diff2html.css b/src/ui/css/diff2html.css index beccebb0..e110ffbf 100644 --- a/src/ui/css/diff2html.css +++ b/src/ui/css/diff2html.css @@ -74,7 +74,7 @@ .d2h-file-collapse { justify-content: flex-end; - display: flex; + display: none; cursor: pointer; font-size: 12px; align-items: center; diff --git a/src/ui/js/diff2html-ui-base.ts b/src/ui/js/diff2html-ui-base.ts index 20bdd6c9..f6f6cfbf 100644 --- a/src/ui/js/diff2html-ui-base.ts +++ b/src/ui/js/diff2html-ui-base.ts @@ -112,7 +112,9 @@ export class Diff2HtmlUI { } fileContentToggle(): void { - this.targetElement.querySelectorAll('.d2h-file-collapse').forEach(fileContentToggleBtn => { + this.targetElement.querySelectorAll('.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')