use directories for structure
This commit is contained in:
30
app/shell/shell.js
Normal file
30
app/shell/shell.js
Normal file
@@ -0,0 +1,30 @@
|
||||
(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);
|
||||
})();
|
Reference in New Issue
Block a user