Sha256: b9ab12dd34a1854f6a0b5eb6ac23058149e08773d83e33cb128b18f8d6a93816
Contents?: true
Size: 536 Bytes
Versions: 44
Compression:
Stored size: 536 Bytes
Contents
import { Controller } from "@hotwired/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
44 entries across 44 versions & 1 rubygems