mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/views: refactor rendering
This commit is contained in:
@ -18,7 +18,9 @@ class HelpController {
|
||||
|
||||
showHelpRoute(section) {
|
||||
topNavController.activate('help');
|
||||
this.helpView.render(section);
|
||||
this.helpView.render({
|
||||
section: section,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ class HomeController {
|
||||
|
||||
indexRoute() {
|
||||
topNavController.activate('home');
|
||||
this.homeView.render();
|
||||
this.homeView.render({});
|
||||
}
|
||||
|
||||
notFoundRoute() {
|
||||
|
@ -32,17 +32,16 @@ class TopNavController {
|
||||
'help': new NavigationItem('E', 'Help', '/help'),
|
||||
};
|
||||
|
||||
events.listen(
|
||||
events.Authentication,
|
||||
() => {
|
||||
this.updateVisibility();
|
||||
this.topNavView.render(this.items, this.activeItem);
|
||||
this.topNavView.activate(this.activeItem);
|
||||
});
|
||||
const rerender = () => {
|
||||
this.updateVisibility();
|
||||
this.topNavView.render({
|
||||
items: this.items,
|
||||
activeItem: this.activeItem});
|
||||
this.topNavView.activate(this.activeItem);
|
||||
};
|
||||
|
||||
this.updateVisibility();
|
||||
this.topNavView.render(this.items, this.activeItem);
|
||||
this.topNavView.activate(this.activeItem);
|
||||
events.listen(events.Authentication, rerender);
|
||||
rerender();
|
||||
}
|
||||
|
||||
updateVisibility() {
|
||||
|
@ -54,7 +54,7 @@ class UsersController {
|
||||
this.user = response.user;
|
||||
next();
|
||||
}).catch(response => {
|
||||
this.userView.empty();
|
||||
this.userView.emptyView(this.userView.contentHolder);
|
||||
events.notify(events.Error, response.description);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user