refs #750 Switch focus between Public and Toot Detail using shortcut keys
This commit is contained in:
parent
c8df200dc6
commit
068cce09b8
|
@ -14,6 +14,7 @@
|
||||||
v-on:delete="deleteToot"
|
v-on:delete="deleteToot"
|
||||||
@focusNext="focusNext"
|
@focusNext="focusNext"
|
||||||
@focusPrev="focusPrev"
|
@focusPrev="focusPrev"
|
||||||
|
@focusRight="focusSidebar"
|
||||||
@selectToot="focusToot(message)"
|
@selectToot="focusToot(message)"
|
||||||
>
|
>
|
||||||
</toot>
|
</toot>
|
||||||
|
@ -33,6 +34,7 @@ import { mapState, mapGetters } from 'vuex'
|
||||||
import Toot from '~/src/renderer/components/molecules/Toot'
|
import Toot from '~/src/renderer/components/molecules/Toot'
|
||||||
import scrollTop from '../../utils/scroll'
|
import scrollTop from '../../utils/scroll'
|
||||||
import reloadable from '~/src/renderer/components/mixins/reloadable'
|
import reloadable from '~/src/renderer/components/mixins/reloadable'
|
||||||
|
import { Event } from '~/src/renderer/components/event'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'public',
|
name: 'public',
|
||||||
|
@ -83,6 +85,15 @@ export default {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
this.$store.commit('TimelineSpace/changeLoading', false)
|
this.$store.commit('TimelineSpace/changeLoading', false)
|
||||||
|
|
||||||
|
Event.$on('focus-timeline', () => {
|
||||||
|
// If focusedId does not change, we have to refresh focusedId because Toot component watch change events.
|
||||||
|
const previousFocusedId = this.focusedId
|
||||||
|
this.focusedId = 0
|
||||||
|
this.$nextTick(function () {
|
||||||
|
this.focusedId = previousFocusedId
|
||||||
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
beforeUpdate () {
|
beforeUpdate () {
|
||||||
if (this.$store.state.TimelineSpace.SideMenu.unreadPublicTimeline && this.heading) {
|
if (this.$store.state.TimelineSpace.SideMenu.unreadPublicTimeline && this.heading) {
|
||||||
|
@ -94,6 +105,7 @@ export default {
|
||||||
this.$store.dispatch('TimelineSpace/stopPublicStreaming')
|
this.$store.dispatch('TimelineSpace/stopPublicStreaming')
|
||||||
this.$store.dispatch('TimelineSpace/unbindPublicStreaming')
|
this.$store.dispatch('TimelineSpace/unbindPublicStreaming')
|
||||||
}
|
}
|
||||||
|
Event.$off('focus-timeline')
|
||||||
},
|
},
|
||||||
destroyed () {
|
destroyed () {
|
||||||
this.$store.commit('TimelineSpace/Contents/Public/changeHeading', true)
|
this.$store.commit('TimelineSpace/Contents/Public/changeHeading', true)
|
||||||
|
@ -195,6 +207,9 @@ export default {
|
||||||
focusToot (message) {
|
focusToot (message) {
|
||||||
this.focusedId = message.uri + message.id
|
this.focusedId = message.uri + message.id
|
||||||
},
|
},
|
||||||
|
focusSidebar () {
|
||||||
|
Event.$emit('focus-sidebar')
|
||||||
|
},
|
||||||
handleKey (event) {
|
handleKey (event) {
|
||||||
switch (event.srcKey) {
|
switch (event.srcKey) {
|
||||||
case 'next':
|
case 'next':
|
||||||
|
|
Loading…
Reference in New Issue