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