Commit c8d1618a authored by Denys Mishunov's avatar Denys Mishunov

Unwrapped modules from DOMContentLoaded handler

parent fa79e06f
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