A few more simple efficiency cleanups
This commit is contained in:
parent
596148f4bb
commit
269e25c2e0
|
|
@ -1,6 +1,7 @@
|
||||||
let folderRequest = false;
|
let folderRequest = false;
|
||||||
let lightbox = null;
|
let lightbox = null;
|
||||||
toastr.options.escapeHtml = true;
|
toastr.options.escapeHtml = true;
|
||||||
|
toastr.options.preventDuplicates = true;
|
||||||
|
|
||||||
// This function is executed after the page load completes on the client
|
// This function is executed after the page load completes on the client
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
@ -63,10 +64,9 @@ function cycleSortOrder() {
|
||||||
if ( !data.validated ) {
|
if ( !data.validated ) {
|
||||||
redirectToLogin();
|
redirectToLogin();
|
||||||
return;
|
return;
|
||||||
} else {
|
}
|
||||||
$("#sortorder").html(data.order);
|
$("#sortorder").html(data.order);
|
||||||
getFolderContents();
|
getFolderContents();
|
||||||
}
|
|
||||||
},
|
},
|
||||||
error : function(xhr, stat, err) {
|
error : function(xhr, stat, err) {
|
||||||
toastr.error("There was an error retrieving the cycling sort order.", "API Error...", {timeOut: 15000});
|
toastr.error("There was an error retrieving the cycling sort order.", "API Error...", {timeOut: 15000});
|
||||||
|
|
@ -83,7 +83,6 @@ function cycleSortOrder() {
|
||||||
* - Shows a loading notification to the user.
|
* - Shows a loading notification to the user.
|
||||||
* - Sends an AJAX request to retrieve folder contents as JSON.
|
* - Sends an AJAX request to retrieve folder contents as JSON.
|
||||||
* - If the user is not validated, redirects to the login page.
|
* - If the user is not validated, redirects to the login page.
|
||||||
* - Updates the current path and path navigator.
|
|
||||||
* - Appends each folder or issue entry to the list.
|
* - Appends each folder or issue entry to the list.
|
||||||
* - Removes the loading notification upon completion.
|
* - Removes the loading notification upon completion.
|
||||||
*
|
*
|
||||||
|
|
@ -123,7 +122,6 @@ function getFolderContents() {
|
||||||
* Changes the current folder by sending an AJAX request to update the path on the server.
|
* Changes the current folder by sending an AJAX request to update the path on the server.
|
||||||
* Displays a notification to the user and updates global variables upon success.
|
* Displays a notification to the user and updates global variables upon success.
|
||||||
*
|
*
|
||||||
* @param {string} name - The display name of the folder to open.
|
|
||||||
* @param {string} path - The path of the folder to open.
|
* @param {string} path - The path of the folder to open.
|
||||||
*/
|
*/
|
||||||
function changeFolder(path) {
|
function changeFolder(path) {
|
||||||
|
|
@ -186,6 +184,7 @@ function updateCurrentPage() {
|
||||||
function closeComic() {
|
function closeComic() {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url : 'ajax/closecomic.php',
|
url : 'ajax/closecomic.php',
|
||||||
|
type : 'POST',
|
||||||
dataType : 'json',
|
dataType : 'json',
|
||||||
success : function(data, stat, jqo) {
|
success : function(data, stat, jqo) {
|
||||||
if ( !data.validated ) {
|
if ( !data.validated ) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user