Sha256: 9ac95460574843b28b32380b65cbd7a5eab1162824e9902d3092f148571c0087
Contents?: true
Size: 488 Bytes
Versions: 159
Compression:
Stored size: 488 Bytes
Contents
import { Controller } from '@hotwired/stimulus' // To be used by img_placeholder helper export default class extends Controller { connect () { if (this.element.complete) { this.loaded() } else { this.element.addEventListener('load', () => { this.loaded() }, { once: true }) } } loaded () { this.element.classList.add('fade-in') this.element.style.display = 'block' this.element.parentElement.classList.remove('placeholder') } }
Version data entries
159 entries across 159 versions & 1 rubygems