feature: Add selected state style
This commit is contained in:
parent
49bf898e0e
commit
242fc5ae7b
2 changed files with 12 additions and 2 deletions
|
|
@ -5,6 +5,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
.d2h-d-none {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.d2h-wrapper {
|
||||
text-align: left;
|
||||
}
|
||||
|
|
@ -79,6 +83,10 @@
|
|||
padding: 4px 8px;
|
||||
}
|
||||
|
||||
.d2h-file-collapse.d2h-selected {
|
||||
background-color: #c8e1ff;
|
||||
}
|
||||
|
||||
.d2h-file-collapse-input {
|
||||
margin: 0 4px 0 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,8 +118,10 @@ export class Diff2HtmlUI {
|
|||
.closest('.d2h-file-wrapper')
|
||||
?.querySelector(selector);
|
||||
|
||||
if (fileContents !== null && fileContents !== undefined)
|
||||
fileContents.style.display = fileContents.style.display === 'none' ? '' : 'none';
|
||||
if (fileContents !== null && fileContents !== undefined) {
|
||||
fileContentToggleBtn.classList.toggle('d2h-selected');
|
||||
fileContents.classList.toggle('d2h-d-none');
|
||||
}
|
||||
};
|
||||
|
||||
const toggleHandler: (e: Event) => void = e => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue