szurubooru/client/js/controllers/help_controller.js
rr- 1acceb941d client: refactor linking and routing
Print all links through new uri.js component
Refactor the router to use more predictable parsing
Fix linking to entities with weird names (that contain slashes, + etc.)
2017-01-21 00:13:35 +01:00

24 lines
728 B
JavaScript

'use strict';
const topNavigation = require('../models/top_navigation.js');
const HelpView = require('../views/help_view.js');
class HelpController {
constructor(section, subsection) {
topNavigation.activate('help');
topNavigation.setTitle('Help');
this._helpView = new HelpView(section, subsection);
}
}
module.exports = router => {
router.enter(['help'], (ctx, next) => {
new HelpController();
});
router.enter(['help', ':section'], (ctx, next) => {
new HelpController(ctx.parameters.section);
});
router.enter(['help', ':section', ':subsection'], (ctx, next) => {
new HelpController(ctx.parameters.section, ctx.parameters.subsection);
});
};