diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-10-08 15:42:21 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-10-08 15:42:21 +0900 |
| commit | 1c2dbb914e613caa299b862392757de82bf022aa (patch) | |
| tree | b05deb9d19d2468498a662095ed7e7ee099928e0 /src/client | |
| parent | Add new theme (diff) | |
| download | misskey-1c2dbb914e613caa299b862392757de82bf022aa.tar.gz misskey-1c2dbb914e613caa299b862392757de82bf022aa.tar.bz2 misskey-1c2dbb914e613caa299b862392757de82bf022aa.zip | |
Improve usability
Diffstat (limited to 'src/client')
| -rw-r--r-- | src/client/app/mobile/views/components/notifications.vue | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/client/app/mobile/views/components/notifications.vue b/src/client/app/mobile/views/components/notifications.vue index e1a2967071..d537aefdc8 100644 --- a/src/client/app/mobile/views/components/notifications.vue +++ b/src/client/app/mobile/views/components/notifications.vue @@ -48,6 +48,8 @@ export default Vue.extend({ }, mounted() { + window.addEventListener('scroll', this.onScroll, { passive: true }); + this.connection = (this as any).os.stream.useSharedConnection('main'); this.connection.on('notification', this.onNotification); @@ -69,6 +71,7 @@ export default Vue.extend({ }, beforeDestroy() { + window.removeEventListener('scroll', this.onScroll); this.connection.dispose(); }, @@ -101,6 +104,18 @@ export default Vue.extend({ }); this.notifications.unshift(notification); + }, + + onScroll() { + if (this.$store.state.settings.fetchOnScroll !== false) { + // 親要素が display none だったら弾く + // https://github.com/syuilo/misskey/issues/1569 + // http://d.hatena.ne.jp/favril/20091105/1257403319 + if (this.$el.offsetHeight == 0) return; + + const current = window.scrollY + window.innerHeight; + if (current > document.body.offsetHeight - 8) this.fetchMoreNotifications(); + } } } }); |