From dc8c05373c7ffc413196c6b9fd8f29dbae0cbfaa Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 19:10:12 +0900 Subject: Update timeline.vue --- src/client/app/mobile/views/components/timeline.vue | 1 + 1 file changed, 1 insertion(+) (limited to 'src/client/app/mobile') diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue index 12cc7fcf19..132b5216e3 100644 --- a/src/client/app/mobile/views/components/timeline.vue +++ b/src/client/app/mobile/views/components/timeline.vue @@ -95,6 +95,7 @@ export default Vue.extend({ }); }, onNote(note) { + this.notes.pop(); this.notes.unshift(note); }, onChangeFollowing() { -- cgit v1.2.3-freya From 50baad1fd0e21b90a5392df671f2a997bc8ce6ca Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 20:57:37 +0900 Subject: Update timeline.vue --- src/client/app/mobile/views/components/timeline.vue | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'src/client/app/mobile') 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; } } }); -- cgit v1.2.3-freya From 80a0a9f052b8a792481eb41d12184f8982234fa7 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 21:00:28 +0900 Subject: oops --- src/client/app/mobile/views/components/timeline.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/client/app/mobile') diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue index 15a7b5344e..7bb71cb07a 100644 --- a/src/client/app/mobile/views/components/timeline.vue +++ b/src/client/app/mobile/views/components/timeline.vue @@ -38,7 +38,7 @@ export default Vue.extend({ existMore: false, connection: null, connectionId: null, - isTop: true; + isTop: true }; }, computed: { -- cgit v1.2.3-freya From 9a152162e53bc8d047ed4b85859b7b1806492011 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 23:50:00 +0900 Subject: Update timeline.vue --- src/client/app/mobile/views/components/timeline.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/client/app/mobile') diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue index 7bb71cb07a..17d5d18ff0 100644 --- a/src/client/app/mobile/views/components/timeline.vue +++ b/src/client/app/mobile/views/components/timeline.vue @@ -98,8 +98,7 @@ export default Vue.extend({ }); }, onNote(note) { - if (this.isTop) this.notes.pop(); - this.notes.unshift(note); + this.isTop = window.scrollY < 100; }, onChangeFollowing() { this.fetch(); -- cgit v1.2.3-freya From b4410744836e3573f49c5f45e0ee97b12c44556f Mon Sep 17 00:00:00 2001 From: tamaina Date: Mon, 16 Apr 2018 20:44:55 +0900 Subject: oops --- src/client/app/mobile/views/components/timeline.vue | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/client/app/mobile') diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue index 17d5d18ff0..546270db95 100644 --- a/src/client/app/mobile/views/components/timeline.vue +++ b/src/client/app/mobile/views/components/timeline.vue @@ -62,7 +62,10 @@ export default Vue.extend({ 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?) { -- cgit v1.2.3-freya