diff options
author | Douwe Maan <douwe@selenight.nl> | 2017-04-06 11:44:48 -0500 |
---|---|---|
committer | Douwe Maan <douwe@selenight.nl> | 2017-04-06 11:44:48 -0500 |
commit | 2f6b936218e149316f3734711d830764e6597896 (patch) | |
tree | c2a7251c173d242d147bb3d879df8d47d007a022 | |
parent | 99add8877f27e8e6433a9816564f5be9fab0cd7c (diff) | |
download | gitlab-ce-dm-copy-diff-file-title-as-gfm.tar.gz |
Satisfy Robertcopdm-copy-diff-file-title-as-gfm
-rw-r--r-- | app/helpers/button_helper.rb | 16 | ||||
-rw-r--r-- | changelogs/unreleased/dm-copy-diff-file-title-as-gfm.yml | 4 |
2 files changed, 8 insertions, 12 deletions
diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb index a417c8df8bd..c85e96cf78d 100644 --- a/app/helpers/button_helper.rb +++ b/app/helpers/button_helper.rb @@ -1,10 +1,10 @@ module ButtonHelper # Output a "Copy to Clipboard" button # - # data - Data attributes passed to `content_tag` - # text - Text to copy - # gfm - GitLab Flavored Markdown to copy, if different from `text` - # target - Selector for target element to copy from + # data - Data attributes passed to `content_tag` (default: {}): + # :text - Text to copy (optional) + # :gfm - GitLab Flavored Markdown to copy, if different from `text` (optional) + # :target - Selector for target element to copy from (optional) # # Examples: # @@ -23,14 +23,10 @@ module ButtonHelper # This supports code in app/assets/javascripts/copy_to_clipboard.js that # works around ClipboardJS limitations to allow the context-specific copy/pasting of plain text or GFM. - text = data.delete(:text) - if text + if text = data.delete(:text) data[:clipboard_text] = if gfm = data.delete(:gfm) - { - text: text, - gfm: gfm, - } + { text: text, gfm: gfm } else text end diff --git a/changelogs/unreleased/dm-copy-diff-file-title-as-gfm.yml b/changelogs/unreleased/dm-copy-diff-file-title-as-gfm.yml index 54fd3f5c929..506883bc17d 100644 --- a/changelogs/unreleased/dm-copy-diff-file-title-as-gfm.yml +++ b/changelogs/unreleased/dm-copy-diff-file-title-as-gfm.yml @@ -1,4 +1,4 @@ --- -title: Copy diff file path as GFM -merge_request: +title: After copying a diff file or blob path, pasting it into a comment field will format it as Markdown. +merge_request: 9876 author: |