summaryrefslogtreecommitdiff
path: root/src/client/app/mobile
diff options
context:
space:
mode:
authortamaina <tamaina@hotmail.co.jp>2018-04-15 20:57:37 +0900
committerGitHub <noreply@github.com>2018-04-15 20:57:37 +0900
commit50baad1fd0e21b90a5392df671f2a997bc8ce6ca (patch)
treeb33ba0c5d965b48cc246ac31abfc49b734ce677c /src/client/app/mobile
parentUpdate timeline.vue (diff)
downloadmisskey-50baad1fd0e21b90a5392df671f2a997bc8ce6ca.tar.gz
misskey-50baad1fd0e21b90a5392df671f2a997bc8ce6ca.tar.bz2
misskey-50baad1fd0e21b90a5392df671f2a997bc8ce6ca.zip
Update timeline.vue
Diffstat (limited to 'src/client/app/mobile')
-rw-r--r--src/client/app/mobile/views/components/timeline.vue15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue
index 132b5216e3..15a7b5344e 100644
--- a/src/client/app/mobile/views/components/timeline.vue
+++ b/src/client/app/mobile/views/components/timeline.vue
@@ -37,7 +37,8 @@ export default Vue.extend({
notes: [],
existMore: false,
connection: null,
- connectionId: null
+ connectionId: null,
+ isTop: true;
};
},
computed: {
@@ -53,6 +54,8 @@ export default Vue.extend({
this.connection.on('follow', this.onChangeFollowing);
this.connection.on('unfollow', this.onChangeFollowing);
+ window.addEventListener('scroll', this.onScroll);
+
this.fetch();
},
beforeDestroy() {
@@ -95,11 +98,19 @@ export default Vue.extend({
});
},
onNote(note) {
- this.notes.pop();
+ if (this.isTop) this.notes.pop();
this.notes.unshift(note);
},
onChangeFollowing() {
this.fetch();
+ },
+ onScroll() {
+ if ((this as any).os.i.clientSettings.fetchOnScroll !== false) {
+ const current = window.scrollY + window.innerHeight;
+ if (current > document.body.offsetHeight - 8) this.more();
+ }
+ if (window.scrollY > 100) this.isTop = false;
+ else this.isTop = true;
}
}
});