1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-11-03 00:33:02 +00:00

Fix shelf grid ordering for inverted order at page load

Ordering buttons now visible on medium size screens
This commit is contained in:
Ozzieisaacs
2021-11-02 20:27:50 +04:00
parent c7df8a1a34
commit 95371d0d7f
7 changed files with 18 additions and 20 deletions

View File

@@ -21,10 +21,11 @@ var $list = $("#list").isotope({
itemSelector: ".book",
layoutMode: "fitRows",
getSortData: {
title: ".title",
}
title: ".title"
},
});
$("#desc").click(function() {
if (direction === 0) {
return;
@@ -37,9 +38,10 @@ $("#desc").click(function() {
url: getPath() + "/ajax/view",
data: "{\"" + page + "\": {\"dir\": \"desc\"}}",
});
// invert sorting order to make already inverted start order working
$list.isotope({
sortBy: "name",
sortAscending: true
sortAscending: !$list.data('isotope').options.sortAscending
});
direction = 0;
});
@@ -58,7 +60,7 @@ $("#asc").click(function() {
});
$list.isotope({
sortBy: "name",
sortAscending: false
sortAscending: !$list.data('isotope').options.sortAscending
});
direction = 1;
});