mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-12-25 09:30:33 +00:00
[assets] Replace inline events with addEventListener
; this breaks sliding menu.
This commit is contained in:
parent
7e49b3cb26
commit
62fe2ef600
2 changed files with 6 additions and 6 deletions
|
@ -11,23 +11,23 @@ let BookWyrm = new class {
|
|||
initEventListeners() {
|
||||
// buttons that display or hide content
|
||||
document.querySelectorAll('[data-controls]')
|
||||
.forEach(button => button.onclick = this.toggleAction.bind(this));
|
||||
.forEach(button => button.addEventListener('click', this.toggleAction.bind(this)));
|
||||
|
||||
// javascript interactions (boost/fav)
|
||||
document.querySelectorAll('.interaction')
|
||||
.forEach(button => button.onsubmit = this.interact.bind(this));
|
||||
.forEach(button => button.addEventListener('submit', this.interact.bind(this)));
|
||||
|
||||
// handle aria settings on menus
|
||||
document.querySelectorAll('.pulldown-menu')
|
||||
.forEach(button => button.onclick = this.toggleMenu.bind(this));
|
||||
.forEach(button => button.addEventListener('click', this.toggleMenu.bind(this)));
|
||||
|
||||
// hidden submit button in a form
|
||||
document.querySelectorAll('.hidden-form input')
|
||||
.forEach(button => button.onchange = this.revealForm.bind(this));
|
||||
.forEach(button => button.addEventListener('change', this.revealForm.bind(this)));
|
||||
|
||||
// browser back behavior
|
||||
document.querySelectorAll('[data-back]')
|
||||
.forEach(button => button.onclick = this.back);
|
||||
.forEach(button => button.addEventListener('click', this.back));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,7 @@ let LocalStorageTools = new class {
|
|||
|
||||
// update localstorage
|
||||
document.querySelectorAll('.set-display')
|
||||
.forEach(t => t.onclick = this.updateDisplay.bind(this));
|
||||
.forEach(t => t.addEventListener('click', this.updateDisplay.bind(this)));
|
||||
}
|
||||
|
||||
// set javascript listeners
|
||||
|
|
Loading…
Reference in a new issue