summaryrefslogtreecommitdiff
path: root/src/client/app/mobile
diff options
context:
space:
mode:
authorthekinrar <contact@thekinrar.fr>2018-04-16 21:53:01 +0200
committerthekinrar <contact@thekinrar.fr>2018-04-16 21:53:01 +0200
commit017bc9036fb248ff58b711316aecba9d71beaa50 (patch)
treefa9edab40dc53b9bc0e2a482ae7036b37d3d7f13 /src/client/app/mobile
parentFix translate.en.md (diff)
parentMerge pull request #1479 from tamaina/master (diff)
downloadmisskey-017bc9036fb248ff58b711316aecba9d71beaa50.tar.gz
misskey-017bc9036fb248ff58b711316aecba9d71beaa50.tar.bz2
misskey-017bc9036fb248ff58b711316aecba9d71beaa50.zip
Merge branch 'master' of github.com:syuilo/misskey
Diffstat (limited to 'src/client/app/mobile')
-rw-r--r--src/client/app/mobile/views/components/timeline.vue18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue
index 12cc7fcf19..546270db95 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,13 +54,18 @@ export default Vue.extend({
this.connection.on('follow', this.onChangeFollowing);
this.connection.on('unfollow', this.onChangeFollowing);
+ window.addEventListener('scroll', this.onScroll);
+
this.fetch();
},
beforeDestroy() {
this.connection.off('note', this.onNote);
this.connection.off('follow', this.onChangeFollowing);
this.connection.off('unfollow', this.onChangeFollowing);
+ this.connection.off('unfollow', this.onChangeFollowing);
(this as any).os.stream.dispose(this.connectionId);
+
+ window.removeEventListener('scroll', this.onScroll);
},
methods: {
fetch(cb?) {
@@ -95,10 +101,18 @@ export default Vue.extend({
});
},
onNote(note) {
- this.notes.unshift(note);
+ this.isTop = window.scrollY < 100;
},
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;
}
}
});