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-16 18:51:20 +05:30
|
|
|
this._checkScroll = this._checkScroll.bind(this);
|
2019-02-28 03:20:08 +05:30
|
|
|
}
|
|
|
|
|
2019-06-16 18:51:20 +05:30
|
|
|
render(t) {
|
|
|
|
return t.div({className: "RoomView"}, [
|
|
|
|
t.div({className: "TimelinePanel"}, [
|
|
|
|
t.div({className: "RoomHeader"}, [
|
|
|
|
t.button({className: "back"}),
|
|
|
|
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") {
|
|
|
|
this._timelineList.update({list: this.viewModel.timelineViewModel.tiles});
|
2019-02-28 03:20:08 +05:30
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-06-16 18:51:20 +05:30
|
|
|
_checkScroll() {
|
|
|
|
// const list = this._timelineList.root();
|
|
|
|
}
|
2019-02-28 03:20:08 +05:30
|
|
|
}
|