diff options
Diffstat (limited to 'app/assets/javascripts/behaviors')
-rw-r--r-- | app/assets/javascripts/behaviors/copy_to_clipboard.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/behaviors/copy_to_clipboard.js b/app/assets/javascripts/behaviors/copy_to_clipboard.js index 4b337dce8f3..834defe336b 100644 --- a/app/assets/javascripts/behaviors/copy_to_clipboard.js +++ b/app/assets/javascripts/behaviors/copy_to_clipboard.js @@ -10,10 +10,10 @@ const CLIPBOARD_ERROR_EVENT = 'clipboard-error'; const I18N_ERROR_MESSAGE = __('Copy failed. Please manually copy the value.'); function showTooltip(target, title) { - const { title: originalTitle } = target.dataset; + const { originalTitle } = target.dataset; once('hidden', (tooltip) => { - if (tooltip.target === target) { + if (originalTitle && tooltip.target === target) { target.setAttribute('title', originalTitle); target.setAttribute('aria-label', originalTitle); fixTitle(target); |