Explorar el Código

Sort alphabetically if scores are the same.

master
Ben Kurtovic hace 10 años
padre
commit
be7db80d06
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. +5
    -2
      main.js

+ 5
- 2
main.js Ver fichero

@@ -175,8 +175,11 @@ function submit_edit_form(anime_id, submit_type, submit_button) {
function compare(row1, row2) { function compare(row1, row2) {
var r1 = $(row1).find("span[id^='scoreval']").text(), var r1 = $(row1).find("span[id^='scoreval']").text(),
r2 = $(row2).find("span[id^='scoreval']").text(); r2 = $(row2).find("span[id^='scoreval']").text();
if (r1 == "-" && r2 == "-")
return 0;
if (r1 == r2) {
r1 = $(row1).find("a.animetitle span").text();
r2 = $(row2).find("a.animetitle span").text();
return r1 > r2 ? 1 : -1;
}
if (r1 == "-") if (r1 == "-")
return 1; return 1;
if (r2 == "-") if (r2 == "-")


Cargando…
Cancelar
Guardar