summaryrefslogtreecommitdiff
path: root/src/client/app/mobile
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2018-04-17 07:40:19 +0900
committersyuilo <syuilotan@yahoo.co.jp>2018-04-17 07:40:19 +0900
commita0a2cecc73607eb66f00edf59f2b71ebec9049a7 (patch)
tree1729acea9d86edd899ecf6b9e77fc5dfebb8469b /src/client/app/mobile
parentMerge pull request #1492 from TheKinrar/master (diff)
downloadmisskey-a0a2cecc73607eb66f00edf59f2b71ebec9049a7.tar.gz
misskey-a0a2cecc73607eb66f00edf59f2b71ebec9049a7.tar.bz2
misskey-a0a2cecc73607eb66f00edf59f2b71ebec9049a7.zip
:v:
Diffstat (limited to 'src/client/app/mobile')
-rw-r--r--src/client/app/mobile/views/components/timeline.vue23
1 files changed, 6 insertions, 17 deletions
diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue
index 546270db95..11b82aa456 100644
--- a/src/client/app/mobile/views/components/timeline.vue
+++ b/src/client/app/mobile/views/components/timeline.vue
@@ -37,8 +37,7 @@ export default Vue.extend({
notes: [],
existMore: false,
connection: null,
- connectionId: null,
- isTop: true
+ connectionId: null
};
},
computed: {
@@ -54,18 +53,13 @@ export default Vue.extend({
this.connection.on('follow', this.onChangeFollowing);
this.connection.on('unfollow', this.onChangeFollowing);
- window.addEventListener('scroll', this.onScroll);
-
- this.fetch();
+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?) {
@@ -101,18 +95,13 @@ export default Vue.extend({
});
},
onNote(note) {
- this.isTop = window.scrollY < 100;
+ this.notes.unshift(note);
+
+ const isTop = window.scrollY > 8;
+ if (isTop) this.notes.pop();
},
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;
}
}
});