Sha256: 436534a44dceb056a4b07a443c5f9c3a87b4ce11d676bf19212fd366241676b4
Contents?: true
Size: 762 Bytes
Versions: 3
Compression:
Stored size: 762 Bytes
Contents
import { CocoComponent } from "@assets/js/base/coco"; export default CocoComponent("modalDialog", () => { return { frame: null, init() { this.onFrameLoad = this.onFrameLoad.bind(this); this.frame = this.$el.closest("turbo-frame"); if (this.frame) { this.frame.addEventListener("turbo:frame-load", this.onFrameLoad); } }, close() { this.modal.hide(); }, onFrameLoad() { this.$focus.focus(this.firstInput); }, destroy() { if (this.frame) { this.frame.removeEventListener("turbo:frame-load", this.onFrameLoad); } }, get firstInput() { return this.$root.querySelector( "input:not([type=hidden]), textarea, select" ); }, }; });
Version data entries
3 entries across 3 versions & 1 rubygems