citra-emu
/
citra-web
Archived
1
0
Fork 0

Fix dynamic headers function

This commit is contained in:
BynariStar 2017-07-19 02:23:33 +03:00
parent bff7ea6a19
commit c0f5b922a6
1 changed files with 19 additions and 5 deletions

View File

@ -107,18 +107,32 @@
list.sort("title", {order: "asc"}); list.sort("title", {order: "asc"});
list.on("updated", function(){ list.on("updated", function(list){
$("#compatibility-list tbody tr.key").removeClass("key"); var $list = $(list.list);
if ($("#compatibility-list thead").find("th.asc[data-sort='title'], th.desc[data-sort='title']").length){ var $items = $list.children();
$("#compatibility-list tbody tr[data-key]").each(function(){ $items.removeClass("key");
if ('title' == getLastSorted(list)){
$items.each(function(){
var key = $(this).attr("data-key") var key = $(this).attr("data-key")
if ($("tr[data-key='" + key + "']:first").is($(this))){ if (
$list
.children("[data-key='" + key + "']")
.first()
.is( $(this) )
){
$(this).addClass("key"); $(this).addClass("key");
} }
}) })
} }
}) })
function getLastSorted(list){
var currentSorted = $(list.listContainer).find(".asc, .desc").attr("data-sort");
if ('undefined' !== typeof currentSorted)
list.lastSorted = currentSorted;
return list.lastSorted;
}
function filterTable(_) { function filterTable(_) {
var rating = this.name; var rating = this.name;
var index = this.index; var index = this.index;