Cosmetics
This commit is contained in:
parent
ee5dbcf33e
commit
e569bcb246
21 changed files with 54 additions and 65 deletions
|
|
@ -5,17 +5,16 @@ import { install } from '@github/hotkey'
|
|||
export default class extends Controller {
|
||||
connect() {
|
||||
// Install all the hotkeys on the page
|
||||
console.log("hotkey connect", this.element)
|
||||
this.element.addEventListener("turbo:load", this.handleTurboLoad)
|
||||
for (const el of this.element.parentNode.querySelectorAll('[data-hotkey]')) {
|
||||
console.log(el)
|
||||
console.log(el.dataset)
|
||||
install(el)
|
||||
}
|
||||
}
|
||||
|
||||
handleTurboLoad(event) {
|
||||
for (const el of event.getTarget().querySelectorAll('[data-hotkey]')) {
|
||||
console.log(el)
|
||||
console.log(el.dataset)
|
||||
install(el)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue