Added filtering of authors, series, categories, publishers

This commit is contained in:
Ozzieisaacs
2019-03-03 15:37:53 +01:00
parent fda977b155
commit fb23db57b4
4 changed files with 78 additions and 16 deletions
+1
View File
@@ -130,3 +130,4 @@ input.pill:not(:checked) + label .glyphicon {
.editable-cancel { margin-bottom: 0px !important; margin-left: 7px !important;}
.editable-submit { margin-bottom: 0px !important;}
.filterheader { margin-bottom: 20px; }
+46
View File
@@ -0,0 +1,46 @@
var direction = 0; // Descending order
$("#desc").click(function() {
if (direction === 0) {
return;
}
var list = $('#list');
var listItems = list.children(".row");
list.append(listItems.get().reverse());
console.log("desc")
direction = 0;
});
$("#asc").click(function() {
if (direction === 1) {
return;
}
var list = $('#list');
var listItems = list.children(".row");
list.append(listItems.get().reverse());
console.log("asc")
direction = 1;
});
$("#all").click(function() {
$(".row").each(function() {
$(this).show();
});
});
$(".char").click(function() {
console.log(this.innerText);
var character = this.innerText;
// var listItems = ;
$(".row").each(function() {
if (this.attributes['data-id'].value.charAt(0).toUpperCase() !== character) {
$(this).hide();
} else {
$(this).show();
}
});
});