small fix for uploader

This commit is contained in:
Harry Bomrah 2017-07-05 11:39:15 +08:00
parent 606db80718
commit 4e48166bc6
1 changed files with 2 additions and 3 deletions

View File

@ -72,11 +72,10 @@
autoUpload : false, autoUpload : false,
url : "/admin/hps_learnings/upload_temp_file", url : "/admin/hps_learnings/upload_temp_file",
maxChunkSize : 8 * 1024 * 1024, maxChunkSize : 8 * 1024 * 1024,
acceptFileTypes: /(\.|\/)(zip|ZIP)$/i, acceptFileTypes: /(\.|\/)(zip)$/i,
add : function(e, data){ add : function(e, data){
uploadBtn.removeClass("hide"); uploadBtn.removeClass("hide");
notificationArea.removeClass("error").text(data.files[0].name); notificationArea.removeClass("error").text(data.files[0].name);
return false;
var uploadData = data; var uploadData = data;
uploadBtn.one("click",function(){ uploadBtn.one("click",function(){
$.ajax({ $.ajax({
@ -157,7 +156,7 @@
$("#presentation-file").on("change",function(){ $("#presentation-file").on("change",function(){
var file = $(this)[0].files[0].name.split("."); var file = $(this)[0].files[0].name.split(".");
if(file[file.length - 1] == "zip" || file[file.length - 1] == "ZIP"){ if(file[file.length - 1] == "zip"){
return true; return true;
}else{ }else{
uploadBtn.addClass("hide"); uploadBtn.addClass("hide");