Welcome to mirror list, hosted at ThFree Co, Russian Federation.

clipboard_button.vue « components « vue_shared « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e855ec3c098c5d35ccc90c338718e58f979aba29 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<script>
  /**
   * Falls back to the code used in `copy_to_clipboard.js`
   */
  import tooltip from '../directives/tooltip';

  export default {
    name: 'ClipboardButton',
    directives: {
      tooltip,
    },
    props: {
      text: {
        type: String,
        required: true,
      },
      title: {
        type: String,
        required: true,
      },
      tooltipPlacement: {
        type: String,
        required: false,
        default: 'top',
      },
      tooltipContainer: {
        type: [String, Boolean],
        required: false,
        default: false,
      },
    },
  };
</script>

<template>
  <button
    type="button"
    class="btn btn-transparent btn-clipboard"
    :title="title"
    :data-clipboard-text="text"
    v-tooltip
    :data-container="tooltipContainer"
    :data-placement="tooltipPlacement"
  >
    <i
      aria-hidden="true"
      class="fa fa-clipboard"
    >
    </i>
  </button>
</template>