diff options
author | Connor Shea <connor.james.shea@gmail.com> | 2016-06-17 20:27:18 +0300 |
---|---|---|
committer | Connor Shea <connor.james.shea@gmail.com> | 2016-06-17 20:27:18 +0300 |
commit | 12b39524779e36b2e52e0b64c1d85186355e9415 (patch) | |
tree | 4b5dc1671026359ec423c652114866f24916e59a /app/helpers/button_helper.rb | |
parent | 1ca1ebc09bda279dcbacfcfaf39e0410f94ca985 (diff) |
Fix clibpoard buttons on "Check out branch" modal.
Also document the clipboard_button_with_class method.
Fixes #18794.
Diffstat (limited to 'app/helpers/button_helper.rb')
-rw-r--r-- | app/helpers/button_helper.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb index 07a3f452460..a7ec3730066 100644 --- a/app/helpers/button_helper.rb +++ b/app/helpers/button_helper.rb @@ -22,6 +22,16 @@ module ButtonHelper 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'), |