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

discussion_counter.js « mr_notes « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0bb63a7c0f939b21a6aa67b0088eed49df9ef2b6 (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
import Vue from 'vue';
import DiscussionCounter from '~/notes/components/discussion_counter.vue';
import store from '~/mr_notes/stores';

export function initDiscussionCounter() {
  const el = document.getElementById('js-vue-discussion-counter');

  if (el) {
    const { blocksMerge } = el.dataset;

    // eslint-disable-next-line no-new
    new Vue({
      el,
      name: 'DiscussionCounter',
      components: {
        DiscussionCounter,
      },
      store,
      render(createElement) {
        return createElement('discussion-counter', {
          props: {
            blocksMerge: blocksMerge === 'true',
          },
        });
      },
    });
  }
}