summaryrefslogtreecommitdiff
path: root/client/js/controllers/help_controller.js
blob: c290a6beef9d4e6654d005830cc75d818342381a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"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);
    });
};