-
+
+
+
@@ -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
}
}
}