Handle page resizes on history, bumped to v12
This commit is contained in:
parent
7002a00972
commit
9c07611f95
6 changed files with 108 additions and 195 deletions
|
|
@ -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))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue