-
+
+
+
@@ -24,7 +34,8 @@ export default {
components: { Toot },
data () {
return {
- heading: true
+ heading: true,
+ focusedIndex: null
}
},
computed: {
@@ -68,6 +79,13 @@ export default {
this.$store.commit('TimelineSpace/HeaderMenu/changeReload', false)
})
}
+ },
+ focusedIndex: function (newState, oldState) {
+ if (newState > 0 && this.heading) {
+ this.heading = false
+ } else if (newState === null && !this.heading) {
+ this.heading = true
+ }
}
},
methods: {
@@ -92,6 +110,7 @@ export default {
this.heading = false
} else if ((event.target.scrollTop <= 10) && !this.heading) {
this.heading = true
+ this.focusedIndex = null
}
},
async reload () {
@@ -129,6 +148,24 @@ export default {
document.getElementById('scrollable'),
0
)
+ this.focusedIndex = null
+ },
+ focusNext () {
+ if (this.focusedIndex === null) {
+ this.focusedIndex = 0
+ } else if (this.focusedIndex < this.favourites.length) {
+ this.focusedIndex++
+ }
+ },
+ focusPrev () {
+ if (this.focusedIndex === 0) {
+ this.focusedIndex = null
+ } else if (this.focusedIndex > 0) {
+ this.focusedIndex--
+ }
+ },
+ focusToot (index) {
+ this.focusedIndex = index
}
}
}