Sha256: e0be7902251295ce76753b8666e758f3595de66f81e7d35a8c0bcb8b53e85640
Contents?: true
Size: 764 Bytes
Versions: 7
Compression:
Stored size: 764 Bytes
Contents
import { CocoComponent } from "@assets/js/shared/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
7 entries across 7 versions & 1 rubygems