diff options
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 |