diff options
Diffstat (limited to 'app/assets/javascripts/behaviors')
-rw-r--r-- | app/assets/javascripts/behaviors/copy_code.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/assets/javascripts/behaviors/copy_code.js b/app/assets/javascripts/behaviors/copy_code.js index 970864eef74..218a402772f 100644 --- a/app/assets/javascripts/behaviors/copy_code.js +++ b/app/assets/javascripts/behaviors/copy_code.js @@ -5,6 +5,8 @@ import { setAttributes } from '~/lib/utils/dom_utils'; class CopyCodeButton extends HTMLElement { connectedCallback() { + if (this.querySelector('.btn')) return; + this.for = uniqueId('code-'); const target = this.parentNode.querySelector('pre'); |