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 loadAwardsHandler from '~/awards_handler';
import { SnippetShowInit } from '~/snippets';
import SnippetsShow from '~/snippets/components/show.vue';
import SnippetsAppFactory from '~/snippets';
import ZenMode from '~/zen_mode';
document.addEventListener('DOMContentLoaded', () => {
SnippetShowInit();
initNotes();
loadAwardsHandler();
SnippetsAppFactory(document.getElementById('js-snippet-view'), SnippetsShow);
// eslint-disable-next-line no-new
new ZenMode();
});
initNotes();
loadAwardsHandler();
// eslint-disable-next-line no-new
new ZenMode();
......@@ -8,7 +8,7 @@ import { SNIPPET_LEVELS_MAP, SNIPPET_VISIBILITY_PRIVATE } from '~/snippets/const
Vue.use(VueApollo);
Vue.use(Translate);
function appFactory(el, Component) {
export default function appFactory(el, Component) {
if (!el) {
return false;
}
......@@ -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 = () => {
import('./components/edit.vue')
.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