Commit cda8b724 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '270050-unwrap-code' into 'master'

Unwrapped modules from DOMContentLoaded handler

See merge request gitlab-org/gitlab!45503
parents d20b46c4 c8d1618a
import initNotes from '~/init_notes'; import initNotes from '~/init_notes';
import loadAwardsHandler from '~/awards_handler'; import loadAwardsHandler from '~/awards_handler';
import { SnippetShowInit } from '~/snippets'; import SnippetsShow from '~/snippets/components/show.vue';
import SnippetsAppFactory from '~/snippets';
import ZenMode from '~/zen_mode'; import ZenMode from '~/zen_mode';
document.addEventListener('DOMContentLoaded', () => { SnippetsAppFactory(document.getElementById('js-snippet-view'), SnippetsShow);
SnippetShowInit();
initNotes();
loadAwardsHandler();
// eslint-disable-next-line no-new initNotes();
new ZenMode(); loadAwardsHandler();
});
// eslint-disable-next-line no-new
new ZenMode();
...@@ -8,7 +8,7 @@ import { SNIPPET_LEVELS_MAP, SNIPPET_VISIBILITY_PRIVATE } from '~/snippets/const ...@@ -8,7 +8,7 @@ import { SNIPPET_LEVELS_MAP, SNIPPET_VISIBILITY_PRIVATE } from '~/snippets/const
Vue.use(VueApollo); Vue.use(VueApollo);
Vue.use(Translate); Vue.use(Translate);
function appFactory(el, Component) { export default function appFactory(el, Component) {
if (!el) { if (!el) {
return false; return false;
} }
...@@ -45,14 +45,6 @@ function appFactory(el, Component) { ...@@ -45,14 +45,6 @@ function appFactory(el, Component) {
}); });
} }
export const SnippetShowInit = () => {
import('./components/show.vue')
.then(({ default: SnippetsShow }) => {
appFactory(document.getElementById('js-snippet-view'), SnippetsShow);
})
.catch(() => {});
};
export const SnippetEditInit = () => { export const SnippetEditInit = () => {
import('./components/edit.vue') import('./components/edit.vue')
.then(({ default: SnippetsEdit }) => { .then(({ default: SnippetsEdit }) => {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment