refs #543 Start focus with j key in favourite
This commit is contained in:
parent
76a83320d1
commit
7ea3ffb4f0
|
@ -2,7 +2,7 @@
|
|||
<div
|
||||
class="status"
|
||||
tabIndex="0"
|
||||
v-shortkey="{next: ['j'], prev: ['k']}"
|
||||
v-shortkey="focused ? {next: ['j'], prev: ['k']} : {}"
|
||||
@shortkey="handleStatusControl"
|
||||
ref="status"
|
||||
@click="$emit('select')"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div
|
||||
class="follow"
|
||||
tabIndex="0"
|
||||
v-shortkey="{next: ['j'], prev: ['k']}"
|
||||
v-shortkey="focused ? {next: ['j'], prev: ['k']} : {}"
|
||||
@shortkey="handleStatusControl"
|
||||
ref="status"
|
||||
@click="$emit('select')"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div
|
||||
class="status"
|
||||
tabIndex="0"
|
||||
v-shortkey="{next: ['j'], prev: ['k']}"
|
||||
v-shortkey="focused ? {next: ['j'], prev: ['k']} : {}"
|
||||
@shortkey="handleStatusControl"
|
||||
ref="status"
|
||||
@click="$emit('select')"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<template>
|
||||
<div id="notifications">
|
||||
<div id="notifications" v-shortkey="{next: ['j']}" @shortkey="handleKey">
|
||||
<div class="unread">{{ unread.length > 0 ? unread.length : '' }}</div>
|
||||
<div v-shortkey="{linux: ['ctrl', 'r'], mac: ['meta', 'r']}" @shortkey="reload()">
|
||||
</div>
|
||||
|
@ -157,6 +157,15 @@ export default {
|
|||
},
|
||||
focusNotification (index) {
|
||||
this.focusedIndex = index
|
||||
},
|
||||
handleKey (event) {
|
||||
switch (event.srcKey) {
|
||||
case 'next':
|
||||
if (!this.focusedIndex) {
|
||||
this.focusedIndex = 0
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue