feat(web): add sorting sasa and tanzaku

This commit is contained in:
2023-02-12 15:35:52 +03:00
parent e72d371ff1
commit e8e32c70f0
3 changed files with 96 additions and 10 deletions
+8
View File
@@ -55,5 +55,13 @@ $(document).on("submit", "#settings", function (e) {
return;
}
}
let sort_f = ($("#files-reverse")[0].checked ? '-' : '') + $("input[type=radio][name=sort-files]:checked").attr("id").slice(9);
let sort_t = ($("#tags-reverse")[0].checked ? '-' : '') + $("input[type=radio][name=sort-tags]:checked").attr("id").slice(8);
if (sort_f !== sort_files && '!' + sort_f !== sort_files) {
localStorage["sort_files"] = sort_files = '!' + sort_f;
}
if (sort_t !== sort_tags && '!' + sort_t !== sort_tags) {
localStorage["sort_tags"] = sort_tags = '!' + sort_t;
}
alert("Successfully updated settings!");
});