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: 3b6c2da166453e7bf134719ed8966dcac86e20f6 (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
52
53
54
55
56
<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,
      },
      cssClass: {
        type: String,
        required: false,
        default: 'btn btn-default btn-transparent btn-clipboard',
      },
    },
  };
</script>

<template>
  <button
    type="button"
    :class="cssClass"
    :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>