Special sort case for position name (number)
This commit is contained in:
parent
8db37bfca0
commit
b3c8bc2913
@ -121,6 +121,11 @@ export default {
|
||||
sortBy(stat: keyof ExtendedFieldingStat): void {
|
||||
this.setKey(stat)
|
||||
|
||||
if (stat === 'pos') {
|
||||
this.fieldingStats.sort((s1, s2) => this.sortOrder * (POS_MAP[s1.pos] - POS_MAP[s2.pos]))
|
||||
return
|
||||
}
|
||||
|
||||
this.fieldingStats.sort((s1, s2) => s2[stat] < s1[stat] ? this.sortOrder : -1 * this.sortOrder)
|
||||
},
|
||||
setKey(stat: keyof ExtendedFieldingStat): void {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user