Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwinniehell <git@winniehell.de>2016-07-09 04:06:12 +0300
committerwinniehell <git@winniehell.de>2016-07-11 15:20:48 +0300
commitf2bf47f4dffacbb34ac3e4ed27f83176e29f9159 (patch)
tree62d74f6d341c3573bbe1bc9c32daa35158e39d80 /app/helpers/button_helper.rb
parent697e9889b610ad5ddd815904167b838488791c75 (diff)
Display tooltip for "Copy to Clipboard" button (!5164)
Diffstat (limited to 'app/helpers/button_helper.rb')
-rw-r--r--app/helpers/button_helper.rb22
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)