Index: src/copybtn.js ================================================================== --- src/copybtn.js +++ src/copybtn.js @@ -1,32 +1,34 @@ /* Manage "Copy Buttons" linked to target elements, to copy the text (or, parts ** thereof) of the target elements to the clipboard. ** -** Newly created buttons are elements with an SVG background icon, -** defined by the "copy-button" class in the default CSS style sheet, and are -** assigned the element ID "copy-". -** -** To simplify customization, the only properties modified for HTML-defined -** buttons are the "onclick" handler, and the "transition" and "opacity" styles -** (used for animation). +** Newly created buttons are */ function makeCopyButton(idTarget,bFlipped,cchLength){ - var elButton = document.createElement("span"); + var elButton = document.createElement("button"); elButton.className = "copy-button"; if( bFlipped ) elButton.className += " copy-button-flipped"; elButton.id = "copy-" + idTarget; initCopyButton(elButton,idTarget,cchLength); return elButton; @@ -36,15 +38,18 @@ var elButton = document.getElementById(idButton); if( elButton ) initCopyButton(elButton,idTarget,cchLength); return elButton; } function initCopyButton(elButton,idTarget,cchLength){ - elButton.style.transition = ""; - elButton.style.opacity = 1; if( idTarget ) elButton.setAttribute("data-copytarget",idTarget); if( cchLength ) elButton.setAttribute("data-copylength",cchLength); elButton.onclick = clickCopyButton; + /* Make sure the