1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

make EventTimeline take an EventTimelineSet

This commit is contained in:
Matthew Hodgson
2016-09-07 21:17:06 +01:00
parent 9b507f6c6c
commit 91f8df8d19
4 changed files with 20 additions and 11 deletions

View File

@@ -58,7 +58,7 @@ function EventTimelineSet(roomId, room, opts) {
this.room = room;
this._timelineSupport = Boolean(opts.timelineSupport);
this._liveTimeline = new EventTimeline(this.roomId);
this._liveTimeline = new EventTimeline(this);
// just a list - *not* ordered.
this._timelines = [this._liveTimeline];
@@ -136,7 +136,7 @@ EventTimelineSet.prototype.resetLiveTimeline = function(backPaginationToken) {
if (!this._timelineSupport) {
// if timeline support is disabled, forget about the old timelines
newTimeline = new EventTimeline(this.roomId);
newTimeline = new EventTimeline(this);
this._timelines = [newTimeline];
this._eventIdToTimeline = {};
} else {
@@ -202,7 +202,7 @@ EventTimelineSet.prototype.addTimeline = function() {
" it.");
}
var timeline = new EventTimeline(this.roomId);
var timeline = new EventTimeline(this);
this._timelines.push(timeline);
return timeline;
};