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

help_popover.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: 051c65bae70f81f962c19e517d42ca56a33e9394 (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
<script>
import { GlButton, GlPopover } from '@gitlab/ui';

/**
 * Render a button with a question mark icon
 * On hover shows a popover. The popover will be dismissed on mouseleave
 */
export default {
  name: 'HelpPopover',
  components: {
    GlButton,
    GlPopover,
  },
  props: {
    options: {
      type: Object,
      required: false,
      default: () => ({}),
    },
  },
};
</script>
<template>
  <span>
    <gl-button ref="popoverTrigger" variant="link" icon="question" tabindex="0" />
    <gl-popover triggers="hover focus" :target="() => $refs.popoverTrigger.$el" v-bind="options">
      <template #title>
        <!-- eslint-disable-next-line vue/no-v-html -->
        <span v-html="options.title"></span>
      </template>
      <template #default>
        <!-- eslint-disable-next-line vue/no-v-html -->
        <div v-html="options.content"></div>
      </template>
    </gl-popover>
  </span>
</template>