#1701 修复在编辑作业时,删附件会导致名称编辑内容丢失
This commit is contained in:
parent
e5e46819b4
commit
38c3b40ca1
|
@ -34,7 +34,8 @@
|
||||||
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},
|
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},
|
||||||
:data => {:confirm => l(:text_are_you_sure)},
|
:data => {:confirm => l(:text_are_you_sure)},
|
||||||
:method => :delete,
|
:method => :delete,
|
||||||
:class => 'delete',
|
:class => 'delete delete-homework-icon',
|
||||||
|
:remote => true,
|
||||||
:title => l(:button_delete) %>
|
:title => l(:button_delete) %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to image_tag('delete.png'), attachment_path(attachment),
|
<%= link_to image_tag('delete.png'), attachment_path(attachment),
|
||||||
|
|
|
@ -850,3 +850,13 @@ function HS_setDate(inputObj){
|
||||||
function redo() {
|
function redo() {
|
||||||
window.location.reload()
|
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…
Reference in New Issue