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