diff options
author | Fatih Acet <acetfatih@gmail.com> | 2016-10-03 21:10:08 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-10-05 16:31:35 +0200 |
commit | 1e1199d1b1beadff646448fb6de8d4124d1e0924 (patch) | |
tree | a5566d18c2db5143bd7999ca8e4eb4b94f5bda14 | |
parent | 467e1ca48ebf6fe1614733e90e0396930f0a2eb9 (diff) | |
download | gitlab-ce-1e1199d1b1beadff646448fb6de8d4124d1e0924.tar.gz |
Merge branch '22022-copy-to-clipboard-tooltip' into 'master'
Fix tooltip text when Copy to cliboard is clicked
## What does this MR do?
Fixes #22022 to change tooltip text to "Copied!" when the "Copy to clipboard" button is clicked.
## Are there points in the code the reviewer needs to double check?
Line 29 in app/assets/javascripts/copy_to_clipboard.js
## Why was this MR needed?
There was a regression that prevents tooltip change on button click for Copy to clipboard.
## Does this MR meet the acceptance criteria?
- [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added
- [x] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md)
- [x] API support added
- Tests
- [x] Added for this feature/bug
- [x] All builds are passing
- [x] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html)
- [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides)
- [x] Branch has no merge conflicts with `master` (if you do - rebase it please)
- [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits)
## What are the relevant issue numbers?
Closes #22022
See merge request !6294
Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/assets/javascripts/copy_to_clipboard.js | 18 |
2 files changed, 10 insertions, 9 deletions
diff --git a/CHANGELOG b/CHANGELOG index 1005da293aa..e5f7d535348 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ Please view this file on the master branch, on stable branches it's out of date. v 8.12.4 (unreleased) + - Fix "Copy to clipboard" tooltip to say "Copied!" when clipboard button is clicked. !6294 (lukehowell) v 8.12.3 - Update Gitlab Shell to support low IO priority for storage moves 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() { |