client/views: refactor rendering

This commit is contained in:
rr-
2016-04-08 10:35:38 +02:00
parent 7871c69aa3
commit 0ceaa8da42
15 changed files with 147 additions and 97 deletions

View File

@ -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() {