diff options
author | Rémy Coutable <remy@rymai.me> | 2016-07-12 09:40:30 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-07-12 09:40:30 +0000 |
commit | b7ba5fa06bfb434c9227a2175f936fc31fd3444f (patch) | |
tree | 960b119b100dcb877c7f82e1028ddfa13a72107d /app/helpers | |
parent | 3999b80e4ebbfad46b093b94ea5ca31c0c3705be (diff) | |
parent | f2bf47f4dffacbb34ac3e4ed27f83176e29f9159 (diff) | |
download | gitlab-ce-b7ba5fa06bfb434c9227a2175f936fc31fd3444f.tar.gz |
Merge branch 'copy-to-clipboard-tooltip' into 'master'
Display tooltip for "Copy to Clipboard" button
## What does this MR do?
Add a tooltip to the "Copy to Clipboard" button.
## Are there points in the code the reviewer needs to double check?
Nope.
## Why was this MR needed?
There was no tooltip.
## What are the relevant issue numbers?
fixes #19640, #19682
## Screenshots
(wrong cursor is the fault of my screenshot program)
![after](/uploads/6b89790fa3a32b06b115ef1461cbcd86/after.png)
See merge request !5164
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/button_helper.rb | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb index 0f097f86816..b478580978b 100644 --- a/app/helpers/button_helper.rb +++ b/app/helpers/button_helper.rb @@ -15,29 +15,13 @@ module ButtonHelper # # See http://clipboardjs.com/#usage def clipboard_button(data = {}) + data = { toggle: 'tooltip', placement: 'bottom', container: 'body' }.merge(data) content_tag :button, icon('clipboard'), class: "btn btn-clipboard", data: data, - type: :button - end - - # Output a "Copy to Clipboard" button with a custom CSS class - # - # data - Data attributes passed to `content_tag` - # css_class - Class passed to the `content_tag` - # - # Examples: - # - # # Define the target element - # clipboard_button_with_class({clipboard_target: "div#foo"}, css_class: "btn-clipboard") - # # => "<button class='btn btn-clipboard' data-clipboard-target='div#foo'>...</button>" - def clipboard_button_with_class(data = {}, css_class: 'btn-clipboard') - content_tag :button, - icon('clipboard'), - class: "btn #{css_class}", - data: data, - type: :button + type: :button, + title: "Copy to Clipboard" end def http_clone_button(project, placement = 'right', append_link: true) |