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

snippet_edit.js « snippet « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a098d17a226122ba0cf653aad7734f08f04660b0 (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 $ from 'jquery';
import initSnippet from '~/snippet/snippet_bundle';
import ZenMode from '~/zen_mode';
import GLForm from '~/gl_form';

document.addEventListener('DOMContentLoaded', () => {
  const form = document.querySelector('.snippet-form');
  const personalSnippetOptions = {
    members: false,
    issues: false,
    mergeRequests: false,
    epics: false,
    milestones: false,
    labels: false,
    snippets: false,
  };
  const projectSnippetOptions = {};

  const options =
    form.dataset.snippetType === 'project' ? projectSnippetOptions : personalSnippetOptions;

  initSnippet();
  new ZenMode(); // eslint-disable-line no-new
  new GLForm($(form), options); // eslint-disable-line no-new
});