diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2018-07-30 16:37:28 +0300 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2018-07-30 16:37:28 +0300 |
commit | 202e37bbaf2c367e9963d0cc292aafd5fa6c5dfe (patch) | |
tree | 3064797caea578826a8b917b258bf1f11161a05e /app/assets/javascripts/vue_shared/components/clipboard_button.vue | |
parent | 036c6db81362e3eff84eefcdb8c1e72bb79ab77c (diff) |
Resolve "Copy diff file path as GFM" is broken
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/clipboard_button.vue')
-rw-r--r-- | app/assets/javascripts/vue_shared/components/clipboard_button.vue | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/app/assets/javascripts/vue_shared/components/clipboard_button.vue b/app/assets/javascripts/vue_shared/components/clipboard_button.vue index d272bf3f55f..945a33d9622 100644 --- a/app/assets/javascripts/vue_shared/components/clipboard_button.vue +++ b/app/assets/javascripts/vue_shared/components/clipboard_button.vue @@ -31,6 +31,11 @@ export default { type: String, required: true, }, + gfm: { + type: String, + required: false, + default: null, + }, title: { type: String, required: true, @@ -51,6 +56,14 @@ export default { default: 'btn-default', }, }, + computed: { + clipboardText() { + if (this.gfm !== null) { + return JSON.stringify({ text: this.text, gfm: this.gfm }); + } + return this.text; + }, + }, }; </script> @@ -59,7 +72,7 @@ export default { v-tooltip :class="cssClass" :title="title" - :data-clipboard-text="text" + :data-clipboard-text="clipboardText" :data-container="tooltipContainer" :data-placement="tooltipPlacement" type="button" |