update UI when hash changes

This commit is contained in:
Bruno Windels
2020-11-30 11:24:08 +01:00
parent 4d15ce40c1
commit f4cd2a5112
7 changed files with 42 additions and 19 deletions
+3 -6
View File
@@ -19,11 +19,8 @@ import {PreviewView} from "./preview/PreviewView.js";
export class RootView extends TemplateView {
render(t, vm) {
return t.div({className: "RootView"}, t.mapView(vm => vm.activeSection, activeSection => {
switch (activeSection) {
case "preview": return new PreviewView(vm.previewViewModel);
default: return null;
}
}));
return t.div({className: "RootView"}, [
t.mapView(vm => vm.previewViewModel, vm => vm ? new PreviewView(vm) : null),
]);
}
}