szurubooru/client/js/controllers/home_controller.js

28 lines
622 B
JavaScript
Raw Normal View History

'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');
2016-04-08 10:35:38 +02:00
this.homeView.render({});
}
notFoundRoute() {
topNavController.activate('');
}
}
module.exports = new HomeController();