Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor() {
const selector = '.code-container .btn-copy';
this.clayTooltip = new ClayTooltip(new SingletonEnforcer());
this.clayClipboard = new Clipboard({
selector,
text: delegateTarget => {
delegateTarget.setAttribute('title', 'Copied');
setTimeout(() => {
delegateTarget.setAttribute('title', 'Copy');
}, 2000);
return delegateTarget.parentNode.querySelector('pre code')
.innerText;
},
});
}