Skip to content
Permalink
Browse files

Update script.js

  • Loading branch information...
natamus committed May 14, 2019
1 parent 73dc06b commit 064ea8faedfe4c7800ce79fd171b8d237e4e5c0a
Showing with 12 additions and 0 deletions.
  1. +12 −0 assets/js/script.js
@@ -100,6 +100,7 @@ function contentevents() {
});
}
sortList("todownloadlist");
checkDownloadButton();
return false;
});

@@ -112,6 +113,7 @@ function contentevents() {
choice.parent().appendTo("#availablelist");
});
sortList("availablelist");
checkDownloadButton();
return false;
});

@@ -163,6 +165,16 @@ function contentevents() {
function sortList(listid) {
$("#" + listid + " a:not('.active')").sort(sort_li).appendTo("#" + listid);
}

function sort_li(a, b){
return ($(b).attr('id')) < ($(a).attr('id')) ? 1 : -1;
}

function checkDownloadButton() {
if ($("#availablelist input:not('.active')").length > 0) {
$("#dlb").addClass("active");
}
else {
$("#dlb").removeClass("active");
}
}

0 comments on commit 064ea8f

Please sign in to comment.
You can’t perform that action at this time.