diff options
author | Luke Howell <luke.howell@gmail.com> | 2016-09-10 14:14:24 -0500 |
---|---|---|
committer | Luke Howell <luke.howell@gmail.com> | 2016-09-29 21:48:11 -0500 |
commit | 1bde1985c22c947a28d4da8d237f5ea8b894c2e0 (patch) | |
tree | a6e6c7560c029ca3a06569f407b475dc0327813b /app/assets | |
parent | 80fef70bb7c9c1cab1ff80e78f94a83d6712e50d (diff) | |
download | gitlab-ce-1bde1985c22c947a28d4da8d237f5ea8b894c2e0.tar.gz |
Fix tooltip for Copy to clipboard button.
Fix "Copy to clipboard" tooltip to say "Copied!" when clipboard button
is clicked.
Closes #22022
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/copy_to_clipboard.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/app/assets/javascripts/copy_to_clipboard.js b/app/assets/javascripts/copy_to_clipboard.js index 3e20db7e308..e23bda2fa4e 100644 --- a/app/assets/javascripts/copy_to_clipboard.js +++ b/app/assets/javascripts/copy_to_clipboard.js @@ -26,15 +26,15 @@ }; showTooltip = function(target, title) { - return $(target).tooltip({ - container: 'body', - html: 'true', - placement: 'auto bottom', - title: title, - trigger: 'manual' - }).tooltip('show').one('mouseleave', function() { - return $(this).tooltip('hide'); - }); + var $target = $(target); + var originalTitle = $target.data('original-title'); + + $target + .attr('title', 'Copied!') + .tooltip('fixTitle') + .tooltip('show') + .attr('title', originalTitle) + .tooltip('fixTitle'); }; $(function() { |