diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 15:08:44 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-24 15:08:44 +0000 |
commit | 120f4aaedc8fe830a3f572491d240d8ee6addefb (patch) | |
tree | a2138baa55dfa67d292fb1a83ce686ee7f5d10a5 /app/assets/javascripts/snippets | |
parent | 729e3765d5feb762df1ccfbc228a8dd4662aa3f9 (diff) | |
download | gitlab-ce-120f4aaedc8fe830a3f572491d240d8ee6addefb.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/snippets')
-rw-r--r-- | app/assets/javascripts/snippets/components/show.vue (renamed from app/assets/javascripts/snippets/components/app.vue) | 0 | ||||
-rw-r--r-- | app/assets/javascripts/snippets/index.js | 17 |
2 files changed, 10 insertions, 7 deletions
diff --git a/app/assets/javascripts/snippets/components/app.vue b/app/assets/javascripts/snippets/components/show.vue index e98f56d87f5..e98f56d87f5 100644 --- a/app/assets/javascripts/snippets/components/app.vue +++ b/app/assets/javascripts/snippets/components/show.vue diff --git a/app/assets/javascripts/snippets/index.js b/app/assets/javascripts/snippets/index.js index 654856f8d14..b826110117c 100644 --- a/app/assets/javascripts/snippets/index.js +++ b/app/assets/javascripts/snippets/index.js @@ -3,19 +3,16 @@ import Translate from '~/vue_shared/translate'; import VueApollo from 'vue-apollo'; import createDefaultClient from '~/lib/graphql'; -import SnippetsApp from './components/app.vue'; +import SnippetsApp from './components/show.vue'; Vue.use(VueApollo); Vue.use(Translate); -export default () => { - const el = document.getElementById('js-snippet-view'); - +function appFactory(el, Component) { if (!el) { return false; } - const { snippetGid } = el.dataset; const apolloProvider = new VueApollo({ defaultClient: createDefaultClient(), }); @@ -24,11 +21,17 @@ export default () => { el, apolloProvider, render(createElement) { - return createElement(SnippetsApp, { + return createElement(Component, { props: { - snippetGid, + ...el.dataset, }, }); }, }); +} + +export const SnippetShowInit = () => { + appFactory(document.getElementById('js-snippet-view'), SnippetsApp); }; + +export default () => {}; |