diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2018-09-18 09:20:06 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2018-09-18 09:20:06 +0900 |
| commit | f66c31c771d31678472dde87712c7109532c930f (patch) | |
| tree | e50185779d835aab724e8f04138052f2dea74504 /src | |
| parent | Improve usability (diff) | |
| download | misskey-f66c31c771d31678472dde87712c7109532c930f.tar.gz misskey-f66c31c771d31678472dde87712c7109532c930f.tar.bz2 misskey-f66c31c771d31678472dde87712c7109532c930f.zip | |
Improve usability & refactoring
Diffstat (limited to 'src')
| -rw-r--r-- | src/client/app/common/keycode.ts | 7 | ||||
| -rw-r--r-- | src/client/app/common/views/components/reaction-picker.vue | 22 |
2 files changed, 9 insertions, 20 deletions
diff --git a/src/client/app/common/keycode.ts b/src/client/app/common/keycode.ts index 0324a5389a..55043ad76b 100644 --- a/src/client/app/common/keycode.ts +++ b/src/client/app/common/keycode.ts @@ -124,15 +124,10 @@ for (let i = 97; i < 123; i++) { // numbers for (let i = 48; i < 58; i++) { - codes[i - 48] = i; + codes[i - 48] = [i, (i - 48) + 96]; } // function keys for (let i = 1; i < 13; i++) { codes['f' + i] = i + 111; } - -// numpad keys -for (let i = 0; i < 10; i++) { - codes['numpad ' + i] = i + 96; -} diff --git a/src/client/app/common/views/components/reaction-picker.vue b/src/client/app/common/views/components/reaction-picker.vue index 4e27fb36e3..f415e89d0e 100644 --- a/src/client/app/common/views/components/reaction-picker.vue +++ b/src/client/app/common/views/components/reaction-picker.vue @@ -73,30 +73,20 @@ export default Vue.extend({ 'enter': this.choose, 'space': this.choose, 'numpad plus': this.choose, + 'up': this.focusUp, + 'right': this.focusRight, + 'down': this.focusDown, + 'left': this.focusLeft, '1': () => this.react('like'), - 'numpad 1': () => this.react('like'), '2': () => this.react('love'), - 'numpad 2': () => this.react('love'), '3': () => this.react('laugh'), - 'numpad 3': () => this.react('laugh'), '4': () => this.react('hmm'), - 'numpad 4': () => this.react('hmm'), '5': () => this.react('surprise'), - 'numpad 5': () => this.react('surprise'), '6': () => this.react('congrats'), - 'numpad 6': () => this.react('congrats'), '7': () => this.react('angry'), - 'numpad 7': () => this.react('angry'), '8': () => this.react('confused'), - 'numpad 8': () => this.react('confused'), '9': () => this.react('rip'), - 'numpad 9': () => this.react('rip'), '0': () => this.react('pudding'), - 'numpad 0': () => this.react('pudding'), - 'up': this.focusUp, - 'right': this.focusRight, - 'down': this.focusDown, - 'left': this.focusLeft, }; } }, @@ -104,6 +94,10 @@ export default Vue.extend({ watch: { focus(i) { this.$refs.buttons.childNodes[i].focus(); + + if (this.showFocus) { + this.title = this.$refs.buttons.childNodes[i].title; + } } }, |