We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cdfea75 commit 1cade9cCopy full SHA for 1cade9c
src/BoardLibrary.vue
@@ -40,10 +40,15 @@ module.exports = {
40
},
41
sorted: function() {
42
// update each game with its index in the array
43
- this.games.forEach(function (value, index) {
44
- value.index = index
+ this.games.forEach(function (game, index) {
+ game.index = index
45
})
46
- return _.sortBy(this.games, [this.sort])
+ // always sort by name, just sort by type first, if necessary
47
+ var sortBy = this.sort == 'type' ? ['type'] : []
48
+ sortBy.push(function (game) {
49
+ return game.name.toLowerCase()
50
+ })
51
+ return _.sortBy(this.games, sortBy)
52
}
53
54
methods: {
0 commit comments