#1701 修复在编辑作业时,删附件会导致名称编辑内容丢失

dev_repository_hjq
guange 11 years ago
parent e5e46819b4
commit 38c3b40ca1

@ -34,7 +34,8 @@
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},
:data => {:confirm => l(:text_are_you_sure)},
:method => :delete,
:class => 'delete',
:class => 'delete delete-homework-icon',
:remote => true,
:title => l(:button_delete) %>
<% else %>
<%= link_to image_tag('delete.png'), attachment_path(attachment),

@ -850,3 +850,13 @@ function HS_setDate(inputObj){
function redo() {
window.location.reload()
}
//// 作业附件删除
$(function(){
$('.attachments a.delete-homework-icon').bind('ajax:complete', //this will work
function(event, data, status, xhr) { //note parametes
$(this).parent('p').remove();
console.log("delete complete.");
});
});

Loading…
Cancel
Save