render grid view in session view
This commit is contained in:
parent
dc1357bb31
commit
7955462dda
1 changed files with 9 additions and 5 deletions
|
@ -19,6 +19,7 @@ import {RoomView} from "./room/RoomView.js";
|
|||
import {TemplateView} from "../general/TemplateView.js";
|
||||
import {RoomPlaceholderView} from "./RoomPlaceholderView.js";
|
||||
import {SessionStatusView} from "./SessionStatusView.js";
|
||||
import {RoomGridView} from "./RoomGridView.js";
|
||||
|
||||
export class SessionView extends TemplateView {
|
||||
render(t, vm) {
|
||||
|
@ -31,10 +32,13 @@ export class SessionView extends TemplateView {
|
|||
t.view(new SessionStatusView(vm.sessionStatusViewModel)),
|
||||
t.div({className: "main"}, [
|
||||
t.view(new LeftPanelView(vm.leftPanelViewModel)),
|
||||
t.mapView(vm => vm.currentRoom, currentRoom => {
|
||||
if (currentRoom) {
|
||||
return new RoomView(currentRoom);
|
||||
} else {
|
||||
t.mapView(vm => vm.middlePanelViewType, middlePanelViewType => {
|
||||
switch (middlePanelViewType) {
|
||||
case "room":
|
||||
return new RoomView(vm.currentRoom);
|
||||
case "roomgrid":
|
||||
return new RoomGridView(vm.roomGridViewModel);
|
||||
case "placeholder":
|
||||
return new RoomPlaceholderView();
|
||||
}
|
||||
})
|
||||
|
|
Reference in a new issue