Handle page resizes on history, bumped to v12

This commit is contained in:
Magnus Åhall 2026-06-07 11:48:10 +02:00
parent 7002a00972
commit 9c07611f95
6 changed files with 108 additions and 195 deletions

View file

@ -30,11 +30,18 @@ export class App {
})
_mbus.subscribe('SHOW_PAGE', ({ detail: { data: { page } } }) => {
const classList = document.querySelector('#main-page').classList
let classList = document.querySelector('#main-page').classList
classList.forEach(e =>
classList.remove(e)
)
classList.add(page)
classList = document.querySelector('#notes2').classList
classList.forEach(e => {
if (e.startsWith('page-'))
classList.remove(e)
})
classList.add('page-'+page)
})
window.addEventListener('keydown', event => this.keyHandler(event))