2019-06-16 18:51:20 +05:30
|
|
|
import TemplateView from "../../general/TemplateView.js";
|
|
|
|
import TimelineList from "./TimelineList.js";
|
2019-02-28 03:20:08 +05:30
|
|
|
|
2019-06-16 18:51:20 +05:30
|
|
|
export default class RoomView extends TemplateView {
|
2019-02-28 03:20:08 +05:30
|
|
|
constructor(viewModel) {
|
2019-06-16 18:51:20 +05:30
|
|
|
super(viewModel, true);
|
2019-02-28 03:20:08 +05:30
|
|
|
this._timelineList = null;
|
|
|
|
}
|
|
|
|
|
2019-06-27 02:44:39 +05:30
|
|
|
render(t, vm) {
|
2019-06-16 18:51:20 +05:30
|
|
|
return t.div({className: "RoomView"}, [
|
|
|
|
t.div({className: "TimelinePanel"}, [
|
|
|
|
t.div({className: "RoomHeader"}, [
|
2019-06-27 02:44:39 +05:30
|
|
|
t.button({className: "back", onClick: () => vm.close()}),
|
2019-06-16 18:51:20 +05:30
|
|
|
t.div({className: "avatar large"}, vm => vm.avatarInitials),
|
|
|
|
t.div({className: "room-description"}, [
|
|
|
|
t.h2(vm => vm.name),
|
|
|
|
]),
|
|
|
|
]),
|
|
|
|
t.div({className: "RoomView_error"}, vm => vm.error),
|
|
|
|
this._timelineList.mount()
|
|
|
|
])
|
2019-02-28 03:20:08 +05:30
|
|
|
]);
|
2019-06-16 18:51:20 +05:30
|
|
|
}
|
2019-02-28 03:20:08 +05:30
|
|
|
|
2019-06-16 18:51:20 +05:30
|
|
|
mount() {
|
|
|
|
this._timelineList = new TimelineList();
|
|
|
|
return super.mount();
|
2019-02-28 03:20:08 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
unmount() {
|
|
|
|
this._timelineList.unmount();
|
2019-06-16 18:51:20 +05:30
|
|
|
super.unmount();
|
2019-02-28 03:20:08 +05:30
|
|
|
}
|
|
|
|
|
2019-06-16 18:51:20 +05:30
|
|
|
update(value, prop) {
|
|
|
|
super.update(value, prop);
|
|
|
|
if (prop === "timelineViewModel") {
|
2019-06-16 20:59:33 +05:30
|
|
|
this._timelineList.update({viewModel: this.viewModel.timelineViewModel});
|
2019-02-28 03:20:08 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|