From 049171e97864050b5d07a8a04f21f8073af81237 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 19:10:12 +0900 Subject: [PATCH 1/6] Update timeline.vue --- src/client/app/mobile/views/components/timeline.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue index 12cc7fcf1..132b5216e 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() { From de7542b939a50753d3cac891ee5d09f82bf8ff24 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 19:30:51 +0900 Subject: [PATCH 2/6] Update timeline.vue --- src/client/app/desktop/views/components/timeline.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue index f148e840a..cdedbac19 100644 --- a/src/client/app/desktop/views/components/timeline.vue +++ b/src/client/app/desktop/views/components/timeline.vue @@ -101,6 +101,7 @@ export default Vue.extend({ sound.play(); } + this.notes.pop(); this.notes.unshift(note); }, onChangeFollowing() { From 78479d3f17cf5147de04acb1c71360be07429060 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 20:50:53 +0900 Subject: [PATCH 3/6] Update timeline.vue --- src/client/app/desktop/views/components/timeline.vue | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue index cdedbac19..266abd64a 100644 --- a/src/client/app/desktop/views/components/timeline.vue +++ b/src/client/app/desktop/views/components/timeline.vue @@ -5,11 +5,11 @@

- %fa:R comments%自分の投稿や、自分がフォローしているユーザーの投稿が表示されます。 + %fa:R comments%%i18n:@empty%

@@ -29,7 +29,8 @@ export default Vue.extend({ notes: [], connection: null, connectionId: null, - date: null + date: null, + isTop: true }; }, computed: { @@ -101,7 +102,7 @@ export default Vue.extend({ sound.play(); } - this.notes.pop(); + if(isTop) this.notes.pop(); this.notes.unshift(note); }, onChangeFollowing() { @@ -112,6 +113,8 @@ export default Vue.extend({ 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; }, onKeydown(e) { if (e.target.tagName != 'INPUT' && e.target.tagName != 'TEXTAREA') { From 4358d61d64caba097016afe2b356ec2e8181b1cd Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 20:57:30 +0900 Subject: [PATCH 4/6] Update timeline.vue --- src/client/app/desktop/views/components/timeline.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue index 266abd64a..829e73106 100644 --- a/src/client/app/desktop/views/components/timeline.vue +++ b/src/client/app/desktop/views/components/timeline.vue @@ -102,7 +102,7 @@ export default Vue.extend({ sound.play(); } - if(isTop) this.notes.pop(); + if (this.isTop) this.notes.pop(); this.notes.unshift(note); }, onChangeFollowing() { From 304c3ef1d7f41303d0e47cdee60ce41da694913a Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 20:57:37 +0900 Subject: [PATCH 5/6] Update timeline.vue --- .../app/mobile/views/components/timeline.vue | 15 +++++++++++++-- 1 file 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 132b5216e..15a7b5344 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; } } }); From d4ce00cb242bdd9c3f49185635b5826f5e4148c2 Mon Sep 17 00:00:00 2001 From: tamaina Date: Sun, 15 Apr 2018 21:00:28 +0900 Subject: [PATCH 6/6] oops --- src/client/app/mobile/views/components/timeline.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/app/mobile/views/components/timeline.vue b/src/client/app/mobile/views/components/timeline.vue index 15a7b5344..7bb71cb07 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: {