summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/vue_shared/components/modal_copy_button.vue
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /app/assets/javascripts/vue_shared/components/modal_copy_button.vue
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/assets/javascripts/vue_shared/components/modal_copy_button.vue')
-rw-r--r--app/assets/javascripts/vue_shared/components/modal_copy_button.vue21
1 files changed, 5 insertions, 16 deletions
diff --git a/app/assets/javascripts/vue_shared/components/modal_copy_button.vue b/app/assets/javascripts/vue_shared/components/modal_copy_button.vue
index 35ba7c665d5..cad4439ecea 100644
--- a/app/assets/javascripts/vue_shared/components/modal_copy_button.vue
+++ b/app/assets/javascripts/vue_shared/components/modal_copy_button.vue
@@ -1,19 +1,16 @@
<script>
import $ from 'jquery';
-import { GlDeprecatedButton, GlTooltipDirective, GlIcon } from '@gitlab/ui';
+import { GlButton, GlTooltipDirective } from '@gitlab/ui';
import Clipboard from 'clipboard';
import { __ } from '~/locale';
export default {
components: {
- GlDeprecatedButton,
- GlIcon,
+ GlButton,
},
-
directives: {
GlTooltip: GlTooltipDirective,
},
-
props: {
text: {
type: String,
@@ -55,15 +52,12 @@ export default {
default: null,
},
},
-
copySuccessText: __('Copied'),
-
computed: {
modalDomId() {
return this.modalId ? `#${this.modalId}` : '';
},
},
-
mounted() {
this.$nextTick(() => {
this.clipboard = new Clipboard(this.$el, {
@@ -83,13 +77,11 @@ export default {
.on('error', e => this.$emit('error', e));
});
},
-
destroyed() {
if (this.clipboard) {
this.clipboard.destroy();
}
},
-
methods: {
updateTooltip(target) {
const $target = $(target);
@@ -112,15 +104,12 @@ export default {
};
</script>
<template>
- <gl-deprecated-button
+ <gl-button
v-gl-tooltip="{ placement: tooltipPlacement, container: tooltipContainer }"
:class="cssClasses"
:data-clipboard-target="target"
:data-clipboard-text="text"
:title="title"
- >
- <slot>
- <gl-icon name="copy-to-clipboard" />
- </slot>
- </gl-deprecated-button>
+ icon="copy-to-clipboard"
+ />
</template>