Merge branch 'guange_dev' of http://repository.trustie.net/xianbo/trustie2 into guange_dev
This commit is contained in:
commit
7dc6f76060
|
@ -1,6 +1,6 @@
|
|||
<span id="attachments_fields" xmlns="http://www.w3.org/1999/html">
|
||||
<% if defined?(container) && container && container.saved_attachments %>
|
||||
<% container.attachments.each_with_index do |attachment, i| %>
|
||||
<% container.saved_attachments.each_with_index do |attachment, i| %>
|
||||
<span id="attachments_p<%= i %>" class="attachment">
|
||||
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename readonly', :readonly=>'readonly')%>
|
||||
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
|
|
|
@ -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…
Reference in New Issue