diff --git a/src/renderer/components/TimelineSpace/Contents/Favourites.vue b/src/renderer/components/TimelineSpace/Contents/Favourites.vue index 4760251d..b263a709 100644 --- a/src/renderer/components/TimelineSpace/Contents/Favourites.vue +++ b/src/renderer/components/TimelineSpace/Contents/Favourites.vue @@ -81,7 +81,7 @@ export default { } }, focusedIndex: function (newState, oldState) { - if (newState > 0 && this.heading) { + if (newState >= 0 && this.heading) { this.heading = false } else if (newState === null && !this.heading) { this.heading = true diff --git a/src/renderer/components/TimelineSpace/Contents/Home.vue b/src/renderer/components/TimelineSpace/Contents/Home.vue index 49caed3e..5f88e173 100644 --- a/src/renderer/components/TimelineSpace/Contents/Home.vue +++ b/src/renderer/components/TimelineSpace/Contents/Home.vue @@ -79,7 +79,7 @@ export default { } }, focusedIndex: function (newState, oldState) { - if (newState > 0 && this.heading) { + if (newState >= 0 && this.heading) { this.$store.commit('TimelineSpace/Contents/Home/changeHeading', false) } else if (newState === null && !this.heading) { this.$store.commit('TimelineSpace/Contents/Home/changeHeading', true) diff --git a/src/renderer/components/TimelineSpace/Contents/Local.vue b/src/renderer/components/TimelineSpace/Contents/Local.vue index 6afc7b76..a97a838a 100644 --- a/src/renderer/components/TimelineSpace/Contents/Local.vue +++ b/src/renderer/components/TimelineSpace/Contents/Local.vue @@ -4,8 +4,18 @@
-
- +
+ +
@@ -25,6 +35,11 @@ import scrollTop from '../../utils/scroll' export default { name: 'local', components: { Toot }, + data () { + return { + focusedIndex: null + } + }, computed: { ...mapState({ backgroundColor: state => state.App.theme.background_color, @@ -62,6 +77,14 @@ export default { this.$store.commit('TimelineSpace/HeaderMenu/changeReload', false) }) } + }, + focusedIndex: function (newState, oldState) { + if (newState >= 0 && this.heading) { + this.$store.commit('TimelineSpace/Contents/Local/changeHeading', false) + } else if (newState === null && !this.heading) { + this.$store.commit('TimelineSpace/Contents/Local/changeHeading', true) + this.$store.commit('TimelineSpace/Contents/Local/mergeTimeline') + } } }, methods: { @@ -87,6 +110,7 @@ export default { } else if ((event.target.scrollTop <= 10) && !this.heading) { this.$store.commit('TimelineSpace/Contents/Local/changeHeading', true) this.$store.commit('TimelineSpace/Contents/Local/mergeTimeline') + this.focusedIndex = null } }, async reload () { @@ -128,6 +152,24 @@ export default { document.getElementById('scrollable'), 0 ) + this.focusedIndex = null + }, + focusNext () { + if (this.focusedIndex === null) { + this.focusedIndex = 0 + } else if (this.focusedIndex < this.timeline.length) { + this.focusedIndex++ + } + }, + focusPrev () { + if (this.focusedIndex === 0) { + this.focusedIndex = null + } else if (this.focusedIndex > 0) { + this.focusedIndex-- + } + }, + focusToot (index) { + this.focusedIndex = index } } }