szurubooru/client/js/controllers/help_controller.js

36 lines
959 B
JavaScript
Raw Normal View History

'use strict';
const router = require('../router.js');
const topNavController = require('../controllers/top_nav_controller.js');
const HelpView = require('../views/help_view.js');
class HelpController {
constructor() {
this._helpView = new HelpView();
}
registerRoutes() {
router.enter(
'/help',
(ctx, next) => { this._showHelpRoute(); });
router.enter(
'/help/:section',
(ctx, next) => { this._showHelpRoute(ctx.params.section); });
router.enter(
'/help/:section/:subsection',
(ctx, next) => {
this._showHelpRoute(ctx.params.section, ctx.params.subsection);
});
}
_showHelpRoute(section, subsection) {
topNavController.activate('help');
this._helpView.render({
2016-04-08 10:35:38 +02:00
section: section,
subsection: subsection,
2016-04-08 10:35:38 +02:00
});
}
}
module.exports = new HelpController();