Sha256: 3ec6398bb485ab731c966fb0361c48e97691840971f8a73649697318cb02e7de
Contents?: true
Size: 710 Bytes
Versions: 22
Compression:
Stored size: 710 Bytes
Contents
import { CocoComponent } from "@assets/js/coco/component"; export default CocoComponent("modalLightbox", () => { return { loaded: false, init() { if (this.img.complete && this.img.naturalHeight !== 0) { this.imageLoaded(); } }, close() { this.modal.hide(); }, imageLoaded() { this.loaded = true; setTimeout(() => { const scrollTop = parseInt(this.img.dataset.scrollTop, 10); if (!isNaN(scrollTop) && scrollTop !== 0) { this.modal.scrollTo(scrollTop); } }, 200); }, get img() { return this.$refs.media.querySelector("img"); }, root: { ":class": "{loaded}", }, }; });
Version data entries
22 entries across 22 versions & 1 rubygems