Skip to content

Commit

Permalink
Better components registeration
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkykh committed Jul 28, 2018
1 parent d1913fb commit 60aefb6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
28 changes: 17 additions & 11 deletions themes-default/slim/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,27 @@ Vue.use(Snotify);

// Load x-template components
window.components.forEach(component => {
console.log(`Registering ${component.name}`);
console.debug(`Registering ${component.name}`);
Vue.component(component.name, component);
});

// Global components
Vue.component('app-header', AppHeader);
Vue.component('scroll-buttons', ScrollButtons);
Vue.component('app-link', AppLink);
Vue.component('asset', Asset);
Vue.component('file-browser', FileBrowser);
Vue.component('plot-info', PlotInfo);
Vue.component('select-list', SelectList);
Vue.component('language-select', LanguageSelect);
Vue.component('root-dirs', RootDirs);
Vue.component('backstretch', Backstretch);
const globalComponents = [
AppHeader,
ScrollButtons,
AppLink,
Asset,
FileBrowser,
PlotInfo,
SelectList,
LanguageSelect,
RootDirs,
Backstretch
];

globalComponents.forEach(component => {
Vue.component(component.name, component);
});

const app = new Vue({
name: 'App',
Expand Down
2 changes: 1 addition & 1 deletion themes/dark/assets/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion themes/light/assets/js/app.js

Large diffs are not rendered by default.

0 comments on commit 60aefb6

Please sign in to comment.