Sha256: 49327631397a19bcee8a1d4e889885ff8b5d44c99c3822438589e929cb48e7c6
Contents?: true
Size: 767 Bytes
Versions: 22
Compression:
Stored size: 767 Bytes
Contents
import { CocoComponent } from "@assets/js/coco/component"; 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
22 entries across 22 versions & 1 rubygems