|
@@ -11,7 +11,7 @@
|
|
|
|
|
|
<hr class="section-horizontal-rule" />
|
|
|
|
|
|
- <div id="activity-items" @scroll="handleScroll">
|
|
|
+ <div id="activity-items">
|
|
|
<activity-item
|
|
|
class="item activity-item universal-item"
|
|
|
v-for="activity in activities"
|
|
@@ -77,6 +77,8 @@ export default {
|
|
|
})
|
|
|
},
|
|
|
mounted() {
|
|
|
+ window.addEventListener("scroll", this.handleScroll);
|
|
|
+
|
|
|
ws.onConnect(this.init);
|
|
|
|
|
|
this.socket.on("event:activity.updated", res => {
|
|
@@ -105,6 +107,9 @@ export default {
|
|
|
this.offsettedFromNextSet = 0;
|
|
|
});
|
|
|
},
|
|
|
+ unmounted() {
|
|
|
+ window.removeEventListener("scroll", this.handleScroll);
|
|
|
+ },
|
|
|
methods: {
|
|
|
init() {
|
|
|
if (this.myUserId !== this.userId)
|
|
@@ -145,14 +150,13 @@ export default {
|
|
|
}
|
|
|
);
|
|
|
},
|
|
|
- handleScroll(event) {
|
|
|
- const scrollPosition =
|
|
|
- event.target.clientHeight + event.target.scrollTop;
|
|
|
- const bottomPosition = event.target.scrollHeight;
|
|
|
+ handleScroll() {
|
|
|
+ const scrollPosition = document.body.clientHeight + window.scrollY;
|
|
|
+ const bottomPosition = document.body.scrollHeight;
|
|
|
|
|
|
if (this.loadAllSongs) return false;
|
|
|
|
|
|
- if (scrollPosition + 100 >= bottomPosition) this.getSet();
|
|
|
+ if (scrollPosition + 400 >= bottomPosition) this.getSet();
|
|
|
|
|
|
return this.maxPosition === this.position;
|
|
|
},
|
|
@@ -167,12 +171,6 @@ export default {
|
|
|
border: 0 !important;
|
|
|
}
|
|
|
|
|
|
-#activity-items {
|
|
|
- overflow: auto;
|
|
|
- min-height: auto;
|
|
|
- max-height: 570px;
|
|
|
-}
|
|
|
-
|
|
|
.content a {
|
|
|
border-bottom: 0;
|
|
|
}
|