forked from mystiq/hydrogen-web
Rename TimelineList to TimelineView for consistency
This commit is contained in:
parent
ed082c9869
commit
c6b020a9e7
4 changed files with 7 additions and 6 deletions
|
@ -22,7 +22,7 @@ export class EncryptedEventTile extends BaseTextTile {
|
|||
const parentResult = super.updateEntry(entry, params);
|
||||
// event got decrypted, recreate the tile and replace this one with it
|
||||
if (entry.eventType !== "m.room.encrypted") {
|
||||
// the "shape" parameter trigger tile recreation in TimelineList
|
||||
// the "shape" parameter trigger tile recreation in TimelineView
|
||||
return UpdateAction.Replace("shape");
|
||||
} else {
|
||||
return parentResult;
|
||||
|
|
|
@ -17,7 +17,7 @@ limitations under the License.
|
|||
import {TemplateView} from "../../general/TemplateView.js";
|
||||
import {Popup} from "../../general/Popup.js";
|
||||
import {Menu} from "../../general/Menu.js";
|
||||
import {viewClassForEntry} from "./TimelineList.js"
|
||||
import {viewClassForEntry} from "./TimelineView.js"
|
||||
|
||||
export class MessageComposer extends TemplateView {
|
||||
constructor(viewModel) {
|
||||
|
|
|
@ -18,7 +18,7 @@ limitations under the License.
|
|||
import {TemplateView} from "../../general/TemplateView.js";
|
||||
import {Popup} from "../../general/Popup.js";
|
||||
import {Menu} from "../../general/Menu.js";
|
||||
import {TimelineList} from "./TimelineList.js";
|
||||
import {TimelineView} from "./TimelineView.js";
|
||||
import {TimelineLoadingView} from "./TimelineLoadingView.js";
|
||||
import {MessageComposer} from "./MessageComposer.js";
|
||||
import {RoomArchivedView} from "./RoomArchivedView.js";
|
||||
|
@ -54,7 +54,7 @@ export class RoomView extends TemplateView {
|
|||
t.div({className: "RoomView_error"}, vm => vm.error),
|
||||
t.mapView(vm => vm.timelineViewModel, timelineViewModel => {
|
||||
return timelineViewModel ?
|
||||
new TimelineList(timelineViewModel) :
|
||||
new TimelineView(timelineViewModel) :
|
||||
new TimelineLoadingView(vm); // vm is just needed for i18n
|
||||
}),
|
||||
t.view(bottomView),
|
||||
|
|
|
@ -40,7 +40,7 @@ export function viewClassForEntry(entry) {
|
|||
}
|
||||
}
|
||||
|
||||
export class TimelineList extends ListView {
|
||||
export class TimelineView extends ListView {
|
||||
constructor(viewModel) {
|
||||
const options = {
|
||||
className: "Timeline bottom-aligned-scroll",
|
||||
|
@ -94,7 +94,8 @@ export class TimelineList extends ListView {
|
|||
this._loadAtTopWhile(() => {
|
||||
const contentHeight = root.scrollHeight;
|
||||
const amountGrown = contentHeight - beforeContentHeight;
|
||||
root.scrollTop = root.scrollTop + (contentHeight - lastContentHeight);
|
||||
const topDiff = contentHeight - lastContentHeight;
|
||||
root.scrollBy(0, topDiff);
|
||||
lastContentHeight = contentHeight;
|
||||
return amountGrown < PAGINATE_OFFSET;
|
||||
});
|
Loading…
Reference in a new issue