2015-06-04 09:57:30 +08:00
|
|
|
<% if @is_destroy%>
|
|
|
|
$("#attachment_<%= @attachment.id%>").remove();
|
2015-12-04 16:21:11 +08:00
|
|
|
if(document.getElementById("uploadReviseBox")) {
|
|
|
|
$("#uploadReviseBox").removeClass('disable_link');
|
|
|
|
$("#choose_revise_attach").attr("onclick","_file.click();");
|
|
|
|
}
|
2015-06-04 09:57:30 +08:00
|
|
|
<%else%>
|
|
|
|
var attachment_html_obj = $('#attachments_<%= j params[:attachment_id] %>');
|
|
|
|
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 start
|
|
|
|
var containerid=$('.remove-upload',attachment_html_obj).data('containerid');
|
|
|
|
if(containerid==undefined){
|
|
|
|
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
|
|
|
var count=$('#attachments_fields>span').length;
|
|
|
|
if(count<=0){
|
|
|
|
$("#upload_file_count").text('<%= l(:label_no_file_uploaded)%>');
|
|
|
|
$(".remove_all").remove();
|
|
|
|
}else{
|
|
|
|
$("#upload_file_count").html("<span id=\"count\">"+count+"</span>"+"个文件"+"已上传");
|
|
|
|
}
|
2015-05-15 11:45:15 +08:00
|
|
|
}else{
|
2015-06-04 09:57:30 +08:00
|
|
|
$('#attachments_<%= j params[:attachment_id] %>').remove();
|
|
|
|
var count=$('#attachments_fields'+containerid+'>span').length;
|
|
|
|
if(count<=0){
|
|
|
|
$('#upload_file_count'+containerid).text('<%= l(:label_no_file_uploaded)%>');
|
|
|
|
var remove_all_html_obj = $(".remove_all").filter(function(index){
|
|
|
|
return $(this).data('containerid')==containerid;
|
|
|
|
});
|
|
|
|
remove_all_html_obj.remove();
|
|
|
|
}else{
|
|
|
|
$('#upload_file_count'+containerid).html("<span id=\"count\">"+count+"</span>"+"个文件"+"已上传");
|
|
|
|
}
|
2015-05-15 11:45:15 +08:00
|
|
|
}
|
2015-12-04 16:21:11 +08:00
|
|
|
|
|
|
|
if(document.getElementById("uploadReviseBox")) {
|
|
|
|
$("#uploadReviseBox").removeClass('disable_link');
|
|
|
|
$("#choose_revise_attach").attr("onclick","_file.click();");
|
|
|
|
}
|
2015-06-04 09:57:30 +08:00
|
|
|
//modify by yutao 2015-5-14 当1个页面存在多个上传控件时此块代码存在bug 故改之 end
|
|
|
|
<% end%>
|