summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-07-12 22:15:30 +0800
committerLin Jen-Shin <godfat@godfat.org>2016-07-12 22:15:30 +0800
commit115a57c2ba512b9414c8a96e6d9d14e58e5eeab3 (patch)
tree3d572a4b31b628571b02e0cfc091d92f6f57557f /app/helpers
parent7b43749e69fac0f50f5b17511c7caf1d819bb767 (diff)
parent850bb6db2facf570a7e0933bbf555f764aeac601 (diff)
downloadgitlab-ce-use-string-in-describe.tar.gz
Merge remote-tracking branch 'upstream/master' into use-string-in-describeuse-string-in-describe
* upstream/master: Expire the branch cache after `git gc` runs Be explicit on merge request discussion variables Improve wording in UI guide Fix expandable diffs CHANGELOG was updated. Style of import project buttons were fixed in the new project page. api: expose {should,force}_remove_source_branch Fix typo in UI guide Add rule about adding new header tab to the ui guide Update the health_check gem to the latest release Display tooltip for "Copy to Clipboard" button (!5164) Remove icons from some buttons which already has text
Diffstat (limited to 'app/helpers')
-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)