diff --git a/js/main.js b/js/main.js index 10ab923..a089be2 100644 --- a/js/main.js +++ b/js/main.js @@ -387,7 +387,8 @@ var mapView = { sortButtons += '
'; sortButtons += ''; sortButtons += ''; - sortButtons += ''; + sortButtons += ''; + sortButtons += ''; sortButtons += ''; sortButtons += ''; sortButtons += ''; @@ -633,7 +634,7 @@ var mapView = { return 0; }); break; - case 'id': + case 'id/cp': sortedPokemon.sort(function(a, b) { if (a.id < b.id) return -1; if (a.id > b.id) return 1; @@ -642,6 +643,15 @@ var mapView = { return 0; }); break; + case 'id/iv': + sortedPokemon.sort(function(a, b) { + if (a.id < b.id) return -1; + if (a.id > b.id) return 1; + if (a.iv > b.iv) return -1; + if (a.iv < b.iv) return 1; + return 0; + }); + break; case 'cp': sortedPokemon.sort(function(a, b) { if (a.cp > b.cp) return -1;