diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-21 10:08:36 +0300 |
commit | 48aff82709769b098321c738f3444b9bdaa694c6 (patch) | |
tree | e00c7c43e2d9b603a5a6af576b1685e400410dee /app/assets/javascripts/snippet/snippet_edit.js | |
parent | 879f5329ee916a948223f8f43d77fba4da6cd028 (diff) |
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/assets/javascripts/snippet/snippet_edit.js')
-rw-r--r-- | app/assets/javascripts/snippet/snippet_edit.js | 35 |
1 files changed, 4 insertions, 31 deletions
diff --git a/app/assets/javascripts/snippet/snippet_edit.js b/app/assets/javascripts/snippet/snippet_edit.js index 3dc74922a77..88677ddd15f 100644 --- a/app/assets/javascripts/snippet/snippet_edit.js +++ b/app/assets/javascripts/snippet/snippet_edit.js @@ -1,33 +1,6 @@ -import $ from 'jquery'; -import initSnippet from '~/snippet/snippet_bundle'; import ZenMode from '~/zen_mode'; -import GLForm from '~/gl_form'; -import { SnippetEditInit } from '~/snippets'; +import SnippetsEdit from '~/snippets/components/edit.vue'; +import SnippetsAppFactory from '~/snippets'; -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, - vulnerabilities: false, - }; - const projectSnippetOptions = {}; - - const options = - form.dataset.snippetType === 'project' || form.dataset.projectPath - ? projectSnippetOptions - : personalSnippetOptions; - - if (gon?.features?.snippetsEditVue) { - SnippetEditInit(); - } else { - initSnippet(); - new GLForm($(form), options); // eslint-disable-line no-new - } - new ZenMode(); // eslint-disable-line no-new -}); +SnippetsAppFactory(document.getElementById('js-snippet-edit'), SnippetsEdit); +new ZenMode(); // eslint-disable-line no-new |