update filtering so that it also uses isotope everywhere.

Fix asc/desc that did not match list view
pull/1306/head
pthiben 4 years ago
parent 2d66da3cb9
commit 58943bb156

@ -26,7 +26,7 @@ var $list = $("#list").isotope({
$("#desc").click(function() { $("#desc").click(function() {
$list.isotope({ $list.isotope({
sortBy: "name", sortBy: "name",
sortAscending: false sortAscending: true
}); });
return; return;
}); });
@ -34,29 +34,21 @@ $("#desc").click(function() {
$("#asc").click(function() { $("#asc").click(function() {
$list.isotope({ $list.isotope({
sortBy: "name", sortBy: "name",
sortAscending: true sortAscending: false
}); });
return; return;
}); });
$("#all").click(function() { $("#all").click(function() {
// go through all elements and make them visible // go through all elements and make them visible
$(".sortable").each(function() { $list.isotope({ filter: function() {
$(this).show(); return true;
}); } })
// We need to trigger the resize event to have all the grid item to re-align.
window.dispatchEvent(new Event('resize'));
}); });
$(".char").click(function() { $(".char").click(function() {
var character = this.innerText; var character = this.innerText;
$(".sortable").each(function() { $list.isotope({ filter: function() {
if (this.attributes["data-id"].value.charAt(0).toUpperCase() !== character) { return this.attributes["data-id"].value.charAt(0).toUpperCase() == character;
$(this).hide(); } })
} else {
$(this).show();
}
});
// We need to trigger the resize event to have all the grid item to re-align.
window.dispatchEvent(new Event("resize"));
}); });

Loading…
Cancel
Save