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

index.js « report_abuse « projects « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 9bcfdbf616517486e2968bd001c458c1971f4868 (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
import Vue from 'vue';
import ReportAbuseDropdownItem from './components/report_abuse_dropdown_item.vue';

export const initReportAbuse = () => {
  const items = document.querySelectorAll('.js-report-abuse-dropdown-item');

  items.forEach((el) => {
    if (!el) return false;

    const { reportAbusePath, reportedUserId, reportedFromUrl } = el.dataset;

    return new Vue({
      el,
      name: 'ReportAbuseDropdownItemRoot',
      provide: {
        reportAbusePath,
        reportedUserId: parseInt(reportedUserId, 10),
        reportedFromUrl,
      },
      render(createElement) {
        return createElement(ReportAbuseDropdownItem);
      },
    });
  });
};