parent
8c2ef10a1f
commit
4be5ba2038
1 changed files with 27 additions and 5 deletions
|
|
@ -83,7 +83,7 @@
|
||||||
v-on:context-menu="showContextMenuForEvent($event)"
|
v-on:context-menu="showContextMenuForEvent($event)"
|
||||||
v-on:own-avatar-clicked="viewProfile"
|
v-on:own-avatar-clicked="viewProfile"
|
||||||
/>
|
/>
|
||||||
<!-- <div>EventID: {{ event.getId() }}</div> -->
|
<!-- <div style="user-select:text">EventID: {{ event.getId() }}</div> -->
|
||||||
<div
|
<div
|
||||||
v-if="event.getId() == readMarker && index < events.length - 1"
|
v-if="event.getId() == readMarker && index < events.length - 1"
|
||||||
class="read-marker"
|
class="read-marker"
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
small
|
small
|
||||||
elevation="0"
|
elevation="0"
|
||||||
color="black"
|
color="black"
|
||||||
@click.stop="smoothScrollToEnd"
|
@click.stop="scrollToEndOfTimeline"
|
||||||
>
|
>
|
||||||
<v-icon color="white">arrow_downward</v-icon>
|
<v-icon color="white">arrow_downward</v-icon>
|
||||||
</v-btn>
|
</v-btn>
|
||||||
|
|
@ -294,8 +294,8 @@
|
||||||
<v-container
|
<v-container
|
||||||
fluid
|
fluid
|
||||||
fill-height
|
fill-height
|
||||||
style="position: absolute"
|
style="position: absolute;background-color:rgba(0,0,0,0.2)"
|
||||||
v-if="!initialLoadDone"
|
v-if="!initialLoadDone || loading"
|
||||||
>
|
>
|
||||||
<v-row align="center" justify="center">
|
<v-row align="center" justify="center">
|
||||||
<v-col class="text-center">
|
<v-col class="text-center">
|
||||||
|
|
@ -420,6 +420,7 @@ export default {
|
||||||
showContextMenu: false,
|
showContextMenu: false,
|
||||||
showContextMenuAnchor: null,
|
showContextMenuAnchor: null,
|
||||||
initialLoadDone: false,
|
initialLoadDone: false,
|
||||||
|
loading: false, // Set this to true during long operations to show a "spinner" overlay
|
||||||
showRecorder: false,
|
showRecorder: false,
|
||||||
showRecorderPTT: false, // True to open the voice recorder in push-to-talk mode.
|
showRecorderPTT: false, // True to open the voice recorder in push-to-talk mode.
|
||||||
|
|
||||||
|
|
@ -619,7 +620,7 @@ export default {
|
||||||
|
|
||||||
console.log("Read up to " + initialEventId);
|
console.log("Read up to " + initialEventId);
|
||||||
|
|
||||||
//initialEventId = null;
|
initialEventId = "$rkyknHVJfTmbICP-lw3MyQ9Kw-cpMOGnh09l_tHg4ss";
|
||||||
|
|
||||||
this.timelineWindow = new TimelineWindow(
|
this.timelineWindow = new TimelineWindow(
|
||||||
this.$matrix.matrixClient,
|
this.$matrix.matrixClient,
|
||||||
|
|
@ -692,6 +693,27 @@ export default {
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
scrollToEndOfTimeline() {
|
||||||
|
if (this.timelineWindow && this.timelineWindow.canPaginate(EventTimeline.FORWARDS)) {
|
||||||
|
this.loading = true;
|
||||||
|
// Instead of paging though ALL history, just reload a timeline at the live marker...
|
||||||
|
var timelineWindow = new TimelineWindow(this.$matrix.matrixClient, this.room.getUnfilteredTimelineSet(), {});
|
||||||
|
const self = this;
|
||||||
|
timelineWindow
|
||||||
|
.load(null, 20)
|
||||||
|
.then(() => {
|
||||||
|
self.timelineWindow = timelineWindow;
|
||||||
|
self.events = self.timelineWindow.getEvents();
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// Can't paginate, just scroll to bottom of window!
|
||||||
|
this.smoothScrollToEnd();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
touchX(event) {
|
touchX(event) {
|
||||||
if (event.type.indexOf("mouse") !== -1) {
|
if (event.type.indexOf("mouse") !== -1) {
|
||||||
return event.clientX;
|
return event.clientX;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue