Files
vanillajs-seed/app/shell/shell.js
2020-05-26 10:37:57 +02:00

31 lines
650 B
JavaScript

(function() {
// globals
MyApp.Shell = {};
// utility functions
// app functions
MyApp.Shell.renderShell = function() {
document.title = i18next.t('vanillaJS');
var d = $.Deferred();
//preload this template, so we can be sure the dom in rendered when we resolve
ejs.preloadTemplate('/app/shell/templates/main.ejs')
.then(function(templateUrl) {
$('.js-main-content').html(ejs.rr(templateUrl));
d.resolve();
});
return d;
};
MyApp.Shell.renderHomePage = function() {
$('.js-page-container').html(ejs.rr('/app/shell/templates/home.ejs'));
};
// events
// app startup
page('/', MyApp.Shell.renderHomePage);
})();