From 7b186c1898934f52f219cbc3308ad22a5125a027 Mon Sep 17 00:00:00 2001 From: Junior Date: Sun, 8 Nov 2026 15:47:57 -0500 Subject: [PATCH] A few small consistency cleanups --- js/comics.js | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/js/comics.js b/js/comics.js index d96fa04..edcd746 100644 --- a/js/comics.js +++ b/js/comics.js @@ -1,5 +1,5 @@ -const NOREFRESH = false; -var folderRequest = false; +let folderRequest = false; +let lightbox = null; toastr.options.escapeHtml = true; // This function is executed after the page load completes on the client @@ -16,8 +16,6 @@ $(document).ready(function() { getSortOrder(); }); -var lightbox = null; - /** * Redirects the user to the login page by replacing the current location with "index.php". * Logs a message to the console before redirecting. @@ -39,10 +37,9 @@ function getSortOrder(refresh = true) { if ( !data.validated ) { redirectToLogin(); return; - } else { - $("#sortorder").html(data.order); - if ( refresh ) getFolderContents(); } + $("#sortorder").html(data.order); + if ( refresh ) getFolderContents(); }, error : function(xhr, stat, err) { toastr.error("There was an error retrieving the current sort order.", "API Error...", {timeOut: 15000}); @@ -161,7 +158,7 @@ function changeFolder(path) { * @returns {void} */ function updateCurrentPage() { - var currentPage = lightbox.currentPosition; + let currentPage = lightbox.currentPosition; $.ajax({ url : 'ajax/setpage.php', type : 'POST', @@ -222,7 +219,7 @@ function showComic(comic, name) { return; } toastr.remove(); - if ( data.images.length == 0 ) { + if ( data.images.length === 0 ) { toastr.error("There doesn't seem to be any images in this comic. Please contact the admin!", "Comics is empty", {timeOut: 8000}); return; }