54e3099c56
- Controller lifetime is bound to route lifetime - View lifetime is bound to controller lifetime - Control lifetime is bound to view lifetime - Enhanced event dispatching - Enhanced responsiveness in some places - Views communicate user input to controllers via new event system
23 lines
664 B
JavaScript
23 lines
664 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');
|
|
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.params.section);
|
|
});
|
|
router.enter('/help/:section/:subsection', (ctx, next) => {
|
|
new HelpController(ctx.params.section, ctx.params.subsection);
|
|
});
|
|
};
|