Sha256: c362ac46ccf947155ca924db1017d79b6bdd3207f57a0abca194ef2377d2fb24
Contents?: true
Size: 457 Bytes
Versions: 27
Compression:
Stored size: 457 Bytes
Contents
import { Controller } from "@hotwired/stimulus" import hotkeys from "libraries/hotkeys" export default class extends Controller { static get targets() { return [ "button" ] } connect() { hotkeys(this.element.dataset.hotkeys, this.handleHotkeys.bind(this)) hotkeys.filter = (event) => true } handleHotkeys(event, handler) { event.preventDefault() if (this.hasButtonTarget) { this.buttonTarget.click() } } }
Version data entries
27 entries across 27 versions & 1 rubygems