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:
authorDouwe Maan <douwe@selenight.nl>2017-04-13 20:13:31 +0300
committerDouwe Maan <douwe@selenight.nl>2017-04-27 20:23:26 +0300
commit30db305dcedfe23635f9fd779a59746fdd5f2e61 (patch)
tree01a5279dd1535537292b8125fd598c7de80a1ab3 /app/helpers/blob_helper.rb
parent0d1ec11e8974b38b0d749a08fde2817c61326441 (diff)
Move conditional inside copy_blob_source_button
Diffstat (limited to 'app/helpers/blob_helper.rb')
-rw-r--r--app/helpers/blob_helper.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index e2092b8bfbf..095032c98e5 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -208,10 +208,10 @@ module BlobHelper
clipboard_button(text: file_path, gfm: "`#{file_path}`", class: 'btn-clipboard btn-transparent prepend-left-5', title: 'Copy file path to clipboard')
end
- def copy_blob_content_button(blob)
- return if markup?(blob.name)
+ def copy_blob_source_button(blob)
+ return unless blob.rendered_as_text?(override_max_size: params[:override_max_size])
- clipboard_button(target: ".blob-content[data-blob-id='#{blob.id}']", class: "btn btn-sm", title: "Copy content to clipboard")
+ clipboard_button(target: ".blob-content[data-blob-id='#{blob.id}']", class: "btn btn-sm js-copy-blob-source-btn", title: "Copy source to clipboard")
end
def open_raw_file_button(path)