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

repo_preview.vue « components « repo « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d8de022335b0cccc848476aa15a502fb7de96680 (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
<script>
import Store from '../stores/repo_store';

export default {
  data: () => Store,
  mounted() {
    $(this.$el).find('.file-content').syntaxHighlight();
  },
  computed: {
    html() {
      return this.activeFile.html;
    },
  },

  watch: {
    html() {
      this.$nextTick(() => {
        $(this.$el).find('.file-content').syntaxHighlight();
      });
    },
  },
};
</script>

<template>
<div>
  <div v-if="!activeFile.render_error" v-html="activeFile.html"></div>
  <div v-if="activeFile.render_error" class="vertical-center render-error">
    <p class="text-center">The source could not be displayed because it is too large. You can <a :href="activeFile.raw_path">download</a> it instead.</p>
  </div>
</div>
</template>