diff options
| author | rr- | 2016-06-12 20:11:43 +0200 |
|---|---|---|
| committer | rr- | 2016-06-12 21:43:20 +0200 |
| commit | 76882b59ef15e6259fc5901db93845478913d250 (patch) | |
| tree | 8daa499f47eaccd1bd7799821c4825b471ecd7e2 /client/js/controllers/help_controller.js | |
| parent | 4295e1c827fd3882bb3f683802912d85d858efb6 (diff) | |
client/router: introduce own router
I'm tired of page.js lack of documentation around finer quirks, and
being forced to read its crap code. Refactored into classes, removed
unused cruft.
Diffstat (limited to 'client/js/controllers/help_controller.js')
| -rw-r--r-- | client/js/controllers/help_controller.js | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/client/js/controllers/help_controller.js b/client/js/controllers/help_controller.js index 6c352c3..73c1896 100644 --- a/client/js/controllers/help_controller.js +++ b/client/js/controllers/help_controller.js @@ -1,6 +1,6 @@ 'use strict'; -const page = require('page'); +const router = require('../router.js'); const topNavController = require('../controllers/top_nav_controller.js'); const HelpView = require('../views/help_view.js'); @@ -10,11 +10,13 @@ class HelpController { } registerRoutes() { - page('/help', () => { this._showHelpRoute(); }); - page( + router.enter( + '/help', + (ctx, next) => { this._showHelpRoute(); }); + router.enter( '/help/:section', (ctx, next) => { this._showHelpRoute(ctx.params.section); }); - page( + router.enter( '/help/:section/:subsection', (ctx, next) => { this._showHelpRoute(ctx.params.section, ctx.params.subsection); |