szurubooru/client/js/controllers/not_found_controller.js
rr- 54e3099c56 client/general: refactor control flow
- 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
2016-06-18 10:35:20 +02:00

17 lines
435 B
JavaScript

'use strict';
const topNavigation = require('../models/top_navigation.js');
const NotFoundView = require('../views/not_found_view.js');
class NotFoundController {
constructor(path) {
topNavigation.activate('');
this._notFoundView = new NotFoundView(path);
}
};
module.exports = router => {
router.enter('*', (ctx, next) => {
ctx.controller = new NotFoundController(ctx.canonicalPath);
});
};