Skip to content

Commit

Permalink
fix: active page highlighting
Browse files Browse the repository at this point in the history
  • Loading branch information
dominiksta committed Aug 30, 2024
1 parent ce9700c commit 1c9922f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"dependencies": {
"@mvuijs/core": "0.0.4",
"@mvuijs/ui5": "1.24.8",
"@ui5/webcomponents": "1.24.8",
"@ui5/webcomponents": "~1.24.8",
"@pdf-lib/fontkit": "^1.1.1",
"ajv": "^8.12.0",
"dompurify": "^3.0.6",
Expand Down
13 changes: 7 additions & 6 deletions src/renderer/document/WournalDocument.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ export class WournalDocument extends Component {
}

render() {
// HACK: revert to static stylesheet once mvui 0.0.5 is out
this.styles.next(style.sheet({
'.wournal-page.active': {
borderColor: `${theme.pageActive} !important`,
}
}));

this.subscribe(this.activePage, p => {
this.pages.value.forEach(p => p.display.classList.remove('active'));
p.display.classList.add('active');
Expand All @@ -107,12 +114,6 @@ export class WournalDocument extends Component {
];
}

static styles = style.sheet({
'.wournal-page.active': {
borderColor: `${theme.pageActive} !important`,
}
})

// ------------------------------------------------------------
// initialization and serialization
// ------------------------------------------------------------
Expand Down

0 comments on commit 1c9922f

Please sign in to comment.