fix upload error

This commit is contained in:
chiu 2020-01-07 20:28:39 +08:00
parent 8c8e44809d
commit b6a473042e
2 changed files with 37 additions and 26 deletions

View File

@ -1,11 +1,14 @@
function form_submit() { function init_upload(temp_length){
var temp_length = $('#file-list').find('li.template-upload').length var value = $("input[name='all_upload_length']")
if (value.val()==''){
value.val(temp_length)
$.ajax({ $.ajax({
type : "post", type : "post",
url : "/admin/galleries/init_upload", url : "/admin/galleries/init_upload",
dataType : "json", dataType : "json",
data:{all_length: temp_length}, data:{all_length: value.val()},
async: false, async: false,
global:false,
success: function() success: function()
{ {
}, },
@ -13,6 +16,14 @@ function form_submit() {
alert('init upload process failed, please try again later.') alert('init upload process failed, please try again later.')
} }
}); });
if (value.val()=='1'){
value.val('')
}
}
}
function form_submit() {
var temp_length = $('#file-list').find('li.template-upload').length
init_upload(temp_length)
var length_upload var length_upload
var count_upload var count_upload
var send_start var send_start
@ -38,25 +49,24 @@ function form_submit() {
window.location.href = '/admin/galleries/upload_process' window.location.href = '/admin/galleries/upload_process'
} }
}) })
$.ajax({
url : "/admin/galleries/start_upload_process",
dataType : "json",
type : "post",
error: function(){
alert('init upload process failed, please try again later.')
},
success: function(){
window.location.href = '/admin/galleries/upload_process'
}
})
} }
}); });
} }
} }
function form_only_one_submit() { function form_only_one_submit() {
var temp_length = 1 var temp_length = 1
$.ajax({ init_upload(temp_length)
type : "post",
url : "/admin/galleries/init_upload",
dataType : "json",
data:{all_length: temp_length},
async: false,
success: function()
{
},
error : function(data){
alert('init upload process failed, please try again later.')
}
});
} }
!function ($) { !function ($) {
$.fn.checkListLength = function (param){ $.fn.checkListLength = function (param){

View File

@ -8,6 +8,7 @@
</ul> </ul>
</div> --> </div> -->
<!-- Bottom Nav --> <!-- Bottom Nav -->
<input name='all_upload_length' type="hidden">
<div class="order-edit-notification">Images re-ordering enabled.</div> <div class="order-edit-notification">Images re-ordering enabled.</div>
<div class="bottomnav clearfix"> <div class="bottomnav clearfix">
<div class="action pull-left"> <div class="action pull-left">