diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-26 15:07:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-26 15:07:48 +0300 |
commit | ef31adeb0fb9a02b2c6a4529ec4e38d7082a4b2b (patch) | |
tree | f0ee2b8bdffd7f91ad0b31388562c90825179585 /app/assets/javascripts/snippet/snippet_edit.js | |
parent | 7e019504f5ac6decde690565857238e7e59aa034 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/snippet/snippet_edit.js')
-rw-r--r-- | app/assets/javascripts/snippet/snippet_edit.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/app/assets/javascripts/snippet/snippet_edit.js b/app/assets/javascripts/snippet/snippet_edit.js new file mode 100644 index 00000000000..a098d17a226 --- /dev/null +++ b/app/assets/javascripts/snippet/snippet_edit.js @@ -0,0 +1,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 +}); |