Move click event for folders and issues up to the main body so it doesn't have to get reset every getFolderContents()

This commit is contained in:
Junior 2026-11-08 15:08:55 -05:00
parent 7418063888
commit a6057ea3d8

View File

@ -4,6 +4,13 @@ const NOREFRESH = false;
$(document).ready(function() {
$("#path").click(function() { changeFolder("/"); });
$("#sortorder").on("click", cycleSortOrder);
$("#list").on("click", ".folder", function() {
changeFolder($(this).data("name"), $(this).data("path"));
});
$("#list").on("click", ".issue", function() {
$(this).parent().addClass("readborder");
showComic($(this).data("relcomic"), $(this).data("comname"));
});
getSortOrder();
});
@ -98,8 +105,6 @@ function getFolderContents() {
data.contents.forEach(function(entry, index) {
$("#list").append(entry.div);
});
$(".folder").click(function() { changeFolder($(this).data("path")); });
$(".issue").click(function() { $(this).parent().addClass("readborder"); showComic($(this).data("relcomic"), $(this).data("comname")); });
toastr.remove();
},
error : function(xhr, stat, err) {