Fossil SCM
Minor tweak to the copybtn.js interface to fall back to the default element ID "copy-IDTARGET".
Commit
16fcd48aa46d909f9441ca3cdb334485e43b8269aeb7fb834e76719df8791963
Parent
678018d3abb4ec7…
1 file changed
+1
+1
| --- src/copybtn.js | ||
| +++ src/copybtn.js | ||
| @@ -30,10 +30,11 @@ | ||
| 30 | 30 | elButton.id = "copy-" + idTarget; |
| 31 | 31 | initCopyButton(elButton,idTarget,cchLength); |
| 32 | 32 | return elButton; |
| 33 | 33 | } |
| 34 | 34 | function initCopyButtonById(idButton,idTarget,cchLength){ |
| 35 | + idButton = idButton || "copy-" + idTarget; | |
| 35 | 36 | var elButton = document.getElementById(idButton); |
| 36 | 37 | if( elButton ) initCopyButton(elButton,idTarget,cchLength); |
| 37 | 38 | return elButton; |
| 38 | 39 | } |
| 39 | 40 | function initCopyButton(elButton,idTarget,cchLength){ |
| 40 | 41 |
| --- src/copybtn.js | |
| +++ src/copybtn.js | |
| @@ -30,10 +30,11 @@ | |
| 30 | elButton.id = "copy-" + idTarget; |
| 31 | initCopyButton(elButton,idTarget,cchLength); |
| 32 | return elButton; |
| 33 | } |
| 34 | function initCopyButtonById(idButton,idTarget,cchLength){ |
| 35 | var elButton = document.getElementById(idButton); |
| 36 | if( elButton ) initCopyButton(elButton,idTarget,cchLength); |
| 37 | return elButton; |
| 38 | } |
| 39 | function initCopyButton(elButton,idTarget,cchLength){ |
| 40 |
| --- src/copybtn.js | |
| +++ src/copybtn.js | |
| @@ -30,10 +30,11 @@ | |
| 30 | elButton.id = "copy-" + idTarget; |
| 31 | initCopyButton(elButton,idTarget,cchLength); |
| 32 | return elButton; |
| 33 | } |
| 34 | function initCopyButtonById(idButton,idTarget,cchLength){ |
| 35 | idButton = idButton || "copy-" + idTarget; |
| 36 | var elButton = document.getElementById(idButton); |
| 37 | if( elButton ) initCopyButton(elButton,idTarget,cchLength); |
| 38 | return elButton; |
| 39 | } |
| 40 | function initCopyButton(elButton,idTarget,cchLength){ |
| 41 |