client/routing: move routing to controllers

This commit is contained in:
rr-
2016-04-06 21:49:26 +02:00
parent 55cc7b59e4
commit 5f29fa12c2
13 changed files with 92 additions and 62 deletions

View File

@ -1,5 +1,6 @@
'use strict';
const page = require('page');
const topNavController = require('../controllers/top_nav_controller.js');
const HelpView = require('../views/help_view.js');
@ -8,6 +9,13 @@ class HelpController {
this.helpView = new HelpView();
}
registerRoutes() {
page('/help', () => { this.showHelpRoute(); });
page(
'/help/:section',
(ctx, next) => { this.showHelpRoute(ctx.params.section); });
}
showHelpRoute(section) {
topNavController.activate('help');
this.helpView.render(section);