Sha256: c22991007e972d6a2c9cb6af542b918f17de78ed12f769c05917bfffe7324f14
Contents?: true
Size: 579 Bytes
Versions: 19
Compression:
Stored size: 579 Bytes
Contents
import "clipboard" import { growl } from "alchemy_admin/growler" class ClipboardButton extends HTMLElement { constructor() { super() this.innerHTML = ` <alchemy-icon name="clipboard"></alchemy-icon> ` this.clipboard = new ClipboardJS(this, { text: () => { return this.getAttribute("content") } }) this.clipboard.on("success", () => { growl(this.getAttribute("success-text")) }) } disconnectedCallback() { this.clipboard.destroy() } } customElements.define("alchemy-clipboard-button", ClipboardButton)
Version data entries
19 entries across 19 versions & 1 rubygems