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

This commit is contained in:
guange 2015-03-11 10:52:09 +08:00
parent e5e46819b4
commit 38c3b40ca1
2 changed files with 12 additions and 1 deletions

View File

@ -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),

View File

@ -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.");
});
});