Merge pull request #366 from huggingface/fix-viewed-checkbox
fix: only display "Viewed" checkbox if `fileContentToggle` is set
This commit is contained in:
commit
e55d145036
2 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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')
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue