69fe8ec31a
- Move controls to the "controls/" directory - Make controls interface look similar to each other - Prefix "private" methods and attributes with underscore
27 lines
628 B
JavaScript
27 lines
628 B
JavaScript
'use strict';
|
|
|
|
const page = require('page');
|
|
const topNavController = require('../controllers/top_nav_controller.js');
|
|
const HomeView = require('../views/home_view.js');
|
|
|
|
class HomeController {
|
|
constructor() {
|
|
this._homeView = new HomeView();
|
|
}
|
|
|
|
registerRoutes() {
|
|
page('/', (ctx, next) => { this._indexRoute(); });
|
|
page('*', (ctx, next) => { this._notFoundRoute(); });
|
|
}
|
|
|
|
_indexRoute() {
|
|
topNavController.activate('home');
|
|
this._homeView.render({});
|
|
}
|
|
|
|
_notFoundRoute() {
|
|
topNavController.activate('');
|
|
}
|
|
}
|
|
|
|
module.exports = new HomeController();
|