mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/general: refactor all the things
- Move controls to the "controls/" directory - Make controls interface look similar to each other - Prefix "private" methods and attributes with underscore
This commit is contained in:
@ -6,20 +6,20 @@ const HomeView = require('../views/home_view.js');
|
||||
|
||||
class HomeController {
|
||||
constructor() {
|
||||
this.homeView = new HomeView();
|
||||
this._homeView = new HomeView();
|
||||
}
|
||||
|
||||
registerRoutes() {
|
||||
page('/', (ctx, next) => { this.indexRoute(); });
|
||||
page('*', (ctx, next) => { this.notFoundRoute(); });
|
||||
page('/', (ctx, next) => { this._indexRoute(); });
|
||||
page('*', (ctx, next) => { this._notFoundRoute(); });
|
||||
}
|
||||
|
||||
indexRoute() {
|
||||
_indexRoute() {
|
||||
topNavController.activate('home');
|
||||
this.homeView.render({});
|
||||
this._homeView.render({});
|
||||
}
|
||||
|
||||
notFoundRoute() {
|
||||
_notFoundRoute() {
|
||||
topNavController.activate('');
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user