minimal working version of user preview

This commit is contained in:
Bruno Windels
2020-11-30 10:57:39 +01:00
parent ead94695f1
commit 4d15ce40c1
8 changed files with 93 additions and 16 deletions
+12 -3
View File
@@ -20,17 +20,26 @@ import {PreviewViewModel} from "./preview/PreviewViewModel.js";
export class RootViewModel extends ViewModel {
constructor(request, hash) {
super();
this._request = request;
super({request});
this.link = Link.parseFragment(hash);
this.previewViewModel = null;
}
load() {
if (this.link) {
this.previewViewModel = new PreviewViewModel(this._request, this.link);
this.previewViewModel = new PreviewViewModel(this.childOptions({
link: this.link,
consentedServers: this.link.servers
}));
this.emitChange();
this.previewViewModel.load();
}
}
get activeSection() {
if (this.previewViewModel) {
return "preview";
}
return "";
}
}