Index: lams_tool_images/web/includes/javascript/imageGalleryitem.js =================================================================== RCS file: /usr/local/cvsroot/lams_tool_images/web/includes/javascript/imageGalleryitem.js,v diff -u -r1.4.2.5 -r1.4.2.6 --- lams_tool_images/web/includes/javascript/imageGalleryitem.js 16 Nov 2016 17:35:32 -0000 1.4.2.5 +++ lams_tool_images/web/includes/javascript/imageGalleryitem.js 17 Nov 2016 16:36:08 -0000 1.4.2.6 @@ -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); } }); }