diff options
| author | rr- | 2016-04-06 21:49:26 +0200 |
|---|---|---|
| committer | rr- | 2016-04-06 22:36:04 +0200 |
| commit | 5f29fa12c28c8f62eaab2ef81ff5b1d01cd1f256 (patch) | |
| tree | e32c7d416d081a282eaa3f1a635d6c80476f4dfb /client/js/controllers/help_controller.js | |
| parent | 55cc7b59e4a9c23810371fa3fa3895ec8c3a7bf8 (diff) | |
client/routing: move routing to controllers
Diffstat (limited to 'client/js/controllers/help_controller.js')
| -rw-r--r-- | client/js/controllers/help_controller.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/client/js/controllers/help_controller.js b/client/js/controllers/help_controller.js index 86788f6..9ee980d 100644 --- a/client/js/controllers/help_controller.js +++ b/client/js/controllers/help_controller.js @@ -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); |