fixed error message on unsuccessful fileupload + list reload
This commit is contained in:
parent
3190217b97
commit
e7508727b6
@ -14,6 +14,7 @@ function init_saimod_sys_files_list(){
|
||||
$.getJSON('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=del&cat='+$(this).attr("cat")+'&id='+$(this).attr("id"), function(data){
|
||||
if(data.status){
|
||||
alert("ok");
|
||||
system.reload();
|
||||
} else{
|
||||
alert("fail");
|
||||
}
|
||||
@ -21,13 +22,18 @@ function init_saimod_sys_files_list(){
|
||||
});
|
||||
|
||||
$(".imgrnbtn").click(function(){
|
||||
$.getJSON('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=rn&cat='+$(this).attr("cat")+'&id='+$(this).attr("id")+'&newid='+$($(this).attr("textfield")).val(), function(data){
|
||||
if(data.status){
|
||||
alert("ok");
|
||||
} else{
|
||||
alert("fail");
|
||||
}
|
||||
});
|
||||
if($($(this).attr("textfield")).val() === ''){
|
||||
alert('Name cant be empty!');
|
||||
} else {
|
||||
$.getJSON('./sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=rn&cat='+$(this).attr("cat")+'&id='+$(this).attr("id")+'&newid='+$($(this).attr("textfield")).val(), function(data){
|
||||
if(data.status){
|
||||
alert("ok");
|
||||
system.reload();
|
||||
} else{
|
||||
alert("fail");
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$('#datei').change(function(){
|
||||
@ -44,7 +50,14 @@ function init_saimod_sys_files_list(){
|
||||
url: './sai.php?sai_mod=.SYSTEM.SAI.saimod_sys_files&action=upload&cat='+$(this).attr('cat'), //Server script to process data
|
||||
type: 'POST',
|
||||
//Ajax events
|
||||
success: function(){alert('ok');},
|
||||
success: function(data){
|
||||
if(data.status){
|
||||
alert('ok');
|
||||
system.reload();
|
||||
} else {
|
||||
alert(data.result.message);
|
||||
}
|
||||
},
|
||||
error: function(){alert('fail');},
|
||||
// Form data
|
||||
data: formData,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user