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:
Diffstat (limited to 'app/assets/javascripts/blob/components/blob_header_default_actions.vue')
-rw-r--r--app/assets/javascripts/blob/components/blob_header_default_actions.vue17
1 files changed, 17 insertions, 0 deletions
diff --git a/app/assets/javascripts/blob/components/blob_header_default_actions.vue b/app/assets/javascripts/blob/components/blob_header_default_actions.vue
index 61baf4fa495..12a198f78ea 100644
--- a/app/assets/javascripts/blob/components/blob_header_default_actions.vue
+++ b/app/assets/javascripts/blob/components/blob_header_default_actions.vue
@@ -54,6 +54,11 @@ export default {
required: false,
default: false,
},
+ overrideCopy: {
+ type: Boolean,
+ required: false,
+ default: false,
+ },
},
computed: {
downloadUrl() {
@@ -63,6 +68,10 @@ export default {
return this.activeViewer === RICH_BLOB_VIEWER;
},
getBlobHashTarget() {
+ if (this.overrideCopy) {
+ return null;
+ }
+
return `[data-blob-hash="${this.blobHash}"]`;
},
showCopyButton() {
@@ -74,6 +83,13 @@ export default {
});
},
},
+ methods: {
+ onCopy() {
+ if (this.overrideCopy) {
+ this.$emit('copy');
+ }
+ },
+ },
BTN_COPY_CONTENTS_TITLE,
BTN_DOWNLOAD_TITLE,
BTN_RAW_TITLE,
@@ -94,6 +110,7 @@ export default {
category="primary"
variant="default"
class="js-copy-blob-source-btn"
+ @click="onCopy"
/>
<gl-button
v-if="!isBinary"