From a6057ea3d8d72891ac8cbf42e7c2b20f9504b05d Mon Sep 17 00:00:00 2001 From: Junior Date: Sun, 8 Nov 2026 15:08:55 -0500 Subject: [PATCH] Move click event for folders and issues up to the main body so it doesn't have to get reset every getFolderContents() --- js/comics.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/js/comics.js b/js/comics.js index 712eb6c..e939381 100644 --- a/js/comics.js +++ b/js/comics.js @@ -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) {