mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-10 12:53:09 +02:00
Improve usability & refactoring
This commit is contained in:
parent
55e2ae1408
commit
f66c31c771
2 changed files with 15 additions and 26 deletions
|
@ -124,15 +124,10 @@ for (let i = 97; i < 123; i++) {
|
||||||
|
|
||||||
// numbers
|
// numbers
|
||||||
for (let i = 48; i < 58; i++) {
|
for (let i = 48; i < 58; i++) {
|
||||||
codes[i - 48] = i;
|
codes[i - 48] = [i, (i - 48) + 96];
|
||||||
}
|
}
|
||||||
|
|
||||||
// function keys
|
// function keys
|
||||||
for (let i = 1; i < 13; i++) {
|
for (let i = 1; i < 13; i++) {
|
||||||
codes['f' + i] = i + 111;
|
codes['f' + i] = i + 111;
|
||||||
}
|
}
|
||||||
|
|
||||||
// numpad keys
|
|
||||||
for (let i = 0; i < 10; i++) {
|
|
||||||
codes['numpad ' + i] = i + 96;
|
|
||||||
}
|
|
||||||
|
|
|
@ -73,30 +73,20 @@ export default Vue.extend({
|
||||||
'enter': this.choose,
|
'enter': this.choose,
|
||||||
'space': this.choose,
|
'space': this.choose,
|
||||||
'numpad plus': this.choose,
|
'numpad plus': this.choose,
|
||||||
'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,
|
'up': this.focusUp,
|
||||||
'right': this.focusRight,
|
'right': this.focusRight,
|
||||||
'down': this.focusDown,
|
'down': this.focusDown,
|
||||||
'left': this.focusLeft,
|
'left': this.focusLeft,
|
||||||
|
'1': () => this.react('like'),
|
||||||
|
'2': () => this.react('love'),
|
||||||
|
'3': () => this.react('laugh'),
|
||||||
|
'4': () => this.react('hmm'),
|
||||||
|
'5': () => this.react('surprise'),
|
||||||
|
'6': () => this.react('congrats'),
|
||||||
|
'7': () => this.react('angry'),
|
||||||
|
'8': () => this.react('confused'),
|
||||||
|
'9': () => this.react('rip'),
|
||||||
|
'0': () => this.react('pudding'),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -104,6 +94,10 @@ export default Vue.extend({
|
||||||
watch: {
|
watch: {
|
||||||
focus(i) {
|
focus(i) {
|
||||||
this.$refs.buttons.childNodes[i].focus();
|
this.$refs.buttons.childNodes[i].focus();
|
||||||
|
|
||||||
|
if (this.showFocus) {
|
||||||
|
this.title = this.$refs.buttons.childNodes[i].title;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue