Skip to content

Commit e55d145

Browse files
authored
Merge pull request #366 from huggingface/fix-viewed-checkbox
fix: only display "Viewed" checkbox if `fileContentToggle` is set
2 parents f046d18 + 7668889 commit e55d145

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/ui/css/diff2html.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474

7575
.d2h-file-collapse {
7676
justify-content: flex-end;
77-
display: flex;
77+
display: none;
7878
cursor: pointer;
7979
font-size: 12px;
8080
align-items: center;

src/ui/js/diff2html-ui-base.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ export class Diff2HtmlUI {
112112
}
113113

114114
fileContentToggle(): void {
115-
this.targetElement.querySelectorAll('.d2h-file-collapse').forEach(fileContentToggleBtn => {
115+
this.targetElement.querySelectorAll<HTMLElement>('.d2h-file-collapse').forEach(fileContentToggleBtn => {
116+
fileContentToggleBtn.style.display = 'flex';
117+
116118
const toggleFileContents: (selector: string) => void = selector => {
117119
const fileContents: HTMLElement | null | undefined = fileContentToggleBtn
118120
.closest('.d2h-file-wrapper')

0 commit comments

Comments
 (0)