-
+
+
+
@@ -25,6 +35,11 @@ import scrollTop from '../../utils/scroll'
export default {
name: 'home',
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/Home/changeHeading', false)
+ } else if (newState === null && !this.heading) {
+ this.$store.commit('TimelineSpace/Contents/Home/changeHeading', true)
+ this.$store.commit('TimelineSpace/Contents/Home/mergeTimeline')
+ }
}
},
methods: {
@@ -82,6 +105,7 @@ export default {
} else if ((event.target.scrollTop <= 10) && !this.heading) {
this.$store.commit('TimelineSpace/Contents/Home/changeHeading', true)
this.$store.commit('TimelineSpace/Contents/Home/mergeTimeline')
+ this.focusedIndex = null
}
},
updateToot (message) {
@@ -129,6 +153,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
}
}
}
diff --git a/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue b/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue
index 228c55d9..412485d1 100644
--- a/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue
+++ b/src/renderer/components/TimelineSpace/Modals/NewToot/Status.vue
@@ -80,7 +80,6 @@ export default {
opened: function (newState, oldState) {
if (!oldState && newState) {
this.$nextTick(function () {
- console.log('focus')
this.$refs.status.focus()
})
} else if (oldState && !newState) {