Sha256: 8281a1cfabe5e3159f8afcf3ed55ee7dc14c52d4037fa508d2e25db699323aa0
Contents?: true
Size: 526 Bytes
Versions: 33
Compression:
Stored size: 526 Bytes
Contents
import { Controller } from 'stimulus' export default class extends Controller { static targets = ['source', 'input', 'button'] copy() { this.inputTarget.value = this.sourceTarget.innerText this.inputTarget.select() document.execCommand('copy') this.buttonTarget.innerHTML = '<i id="copied" class="fas fa-check w-4 h-4 block text-green-600"></i>' setTimeout(function () { document.getElementById('copied').innerHTML = '<i class="far fa-copy w-4 h-4 block text-gray-600"></i>' }, 1500) } }
Version data entries
33 entries across 33 versions & 1 rubygems