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

toolbar_more_dropdown.vue « components « content_editor « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ecde593147cf1f211d02031fc22f2868476908ae (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
<script>
import { GlDropdown, GlDropdownItem, GlTooltipDirective as GlTooltip } from '@gitlab/ui';

export default {
  components: {
    GlDropdown,
    GlDropdownItem,
  },
  directives: {
    GlTooltip,
  },
  inject: ['tiptapEditor'],
  methods: {
    execute(contentType, attrs) {
      this.tiptapEditor.chain().focus().setNode(contentType, attrs).run();

      this.$emit('execute', { contentType });
    },
  },
};
</script>
<template>
  <gl-dropdown size="small" category="tertiary" icon="plus">
    <gl-dropdown-item @click="execute('diagram', { language: 'mermaid' })">
      {{ __('Mermaid diagram') }}
    </gl-dropdown-item>
    <gl-dropdown-item @click="execute('diagram', { language: 'plantuml' })">
      {{ __('PlantUML diagram') }}
    </gl-dropdown-item>
    <gl-dropdown-item @click="execute('horizontalRule')">
      {{ __('Horizontal rule') }}
    </gl-dropdown-item>
  </gl-dropdown>
</template>