Index: lams_tool_images/web/includes/javascript/imageGalleryitem.js =================================================================== diff -u -rf4d9fb8cc51c25fecdd0eac1dcf5f5efc916cdf8 -rf8b98e45847fcee40188af4c9db5d13e1bd61e25 --- lams_tool_images/web/includes/javascript/imageGalleryitem.js (.../imageGalleryitem.js) (revision f4d9fb8cc51c25fecdd0eac1dcf5f5efc916cdf8) +++ lams_tool_images/web/includes/javascript/imageGalleryitem.js (.../imageGalleryitem.js) (revision f8b98e45847fcee40188af4c9db5d13e1bd61e25) @@ -54,18 +54,19 @@ if (file.name.length < 1) { alert("file.name.length < 1"); return; - } else if (file.size > UPLOAD_FILE_LARGE_MAX_SIZE) { - alert(LABEL_MAX_FILE_SIZE); - return; } else if (file.type != 'image/png' && file.type != 'image/jpg' && file.type != 'image/gif' && file.type != 'image/jpeg' ) { alert(LABEL_NOT_ALLOWED_FORMAT); return; + } else if (file.size > UPLOAD_FILE_LARGE_MAX_SIZE) { + alert(LABEL_MAX_FILE_SIZE); + return; } // Add the file to the request. formData.append('file', file, file.name); $('#uploadButtons').hide(); $('#itemAttachmentArea_Busy').show(); + } $.ajax({ @@ -75,9 +76,11 @@ processData: false, contentType: false, success: function(data) { - $('#new-image-input-area').html(data); + $('#new-image-input-area').html(data); }, error: function(jqXHR, textStatus, errorMessage) { + $('#uploadButtons').show(); + $('#itemAttachmentArea_Busy').hide(); alert(errorMessage); } }); @@ -152,7 +155,9 @@ $('#new-image-input-area').html(data); }, error: function(jqXHR, textStatus, errorMessage) { - alert(errorMessage); + $('#uploadButtons').show(); + $('#itemAttachmentArea_Busy').hide(); + alert(errorMessage); } }); }