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

line_header.vue « log « components « jobs « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4ec212d23331f56cbd958a542f28f41074c2ff55 (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
<script>
import Icon from '~/vue_shared/components/icon.vue';
import LineNumber from './line_number.vue';

export default {
  components: {
    Icon,
    LineNumber,
  },
  props: {
    line: {
      type: Object,
      required: true,
    },
    isClosed: {
      type: Boolean,
      required: true,
    },
    path: {
      type: String,
      required: true,
    },
  },
  computed: {
    iconName() {
      return this.isClosed ? 'angle-right' : 'angle-down';
    },
  },
  methods: {
    handleOnClick() {
      this.$emit('toggleLine');
    },
  },
};
</script>

<template>
  <div class="line collapsible-line" role="button" @click="handleOnClick">
    <icon :name="iconName" class="arrow" />
    <line-number :line-number="line.lineNumber" :path="path" />
    <span v-for="(content, i) in line.content" :key="i" class="line-text" :class="content.style">{{
      content.text
    }}</span>
  </div>
</template>