Przeglądaj źródła

Do Not Allow Uploading More Files Until First Operation is Finished

own3mall 8 lat temu
rodzic
commit
b885bd4d1b
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      js/modules/litefm.js

+ 5 - 1
js/modules/litefm.js

@@ -792,7 +792,7 @@ $(document).ready(function(){
 	// upload
 	$("#upload.operations-button").click(function(){
 		if(checkSession() == false) { return; }
-		$('#dialog').html('<div class="status"></div>\
+		$('#dialog').html('<div class="uploadLiteFMStatus status"></div>\
 						  <form id="upload" action="home.php?m=litefm&home_id='+home_id+'&type=cleared&data_type=json" method="post" enctype="multipart/form-data">\
 							<input type="file" name="files[]" multiple="multiple" id="files">\
 							<input type="submit" name="upload" id="uploadsubmit" value="'+upload+'" >\
@@ -858,6 +858,10 @@ $(document).ready(function(){
 				bar.val(percentComplete);
 				percent.html(pVel);
 			},
+			error: function(jqXHR, textStatus, errorThrown){
+				$(".uploadLiteFMStatus").html(textStatus + " " + errorThrown);
+				$("form#upload input#files, form#upload input#uploadsubmit").removeClass('disabled').prop('disabled', false);
+			},
 			/* success call back */
 			success: function(data) {
 				if(typeof data.count !== 'undefined')