Skip to content
Snippets Groups Projects
Commit 46dda62e authored by Midhun Suresh's avatar Midhun Suresh
Browse files

Refactor resize code

parent c8d13a77
No related branches found
No related tags found
No related merge requests found
......@@ -55,9 +55,8 @@ function allowsChild(parent, child) {
}
}
function sendFrameResizeEventToParent(view: string) {
(window as any).sendViewChangeToParent = function (view: "timeline" | "start" | "account-setup") {
window.parent?.postMessage(view);
}
};
(window as any).sendFrameResizeEventToParent = sendFrameResizeEventToParent;
main();
......@@ -10,15 +10,13 @@ export class RootView extends TemplateView<RootViewModel> {
render(t, vm: RootViewModel) {
return t.mapView(vm => vm.activeSection, section => {
(window as any).sendViewChangeToParent(section);
switch(section) {
case "start":
window.sendFrameResizeEventToParent("start");
return new StartView(vm);
case "account-setup":
window.sendFrameResizeEventToParent("account-setup");
return new AccountSetupView(vm.accountSetupViewModel);
case "timeline":
window.sendFrameResizeEventToParent("timeline");
return new ChatterboxView(vm.chatterboxViewModel);
}
return null;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment