redo lost code....

This commit is contained in:
Kaito 2011-07-22 16:28:41 +08:00
parent a272b871e2
commit 1ac10e70a2
3 changed files with 9 additions and 6 deletions

View File

@ -1,11 +1,13 @@
$(".r_snapshot").hover( $(".r_snapshot").live({
mouseenter:
function(){ function(){
$(this).append($("<span></span>").html('<p class="z-preview"><img src="'+$(this).attr("path")+'"width="220" height="19" /></p>')); $(this).append($("<span></span>").html('<p class="z-preview"><img src="'+$(this).attr("path")+'"width="220" height="19" /></p>'));
} },
, mouseleave:
function(){ function(){
$(this).find("span:last").remove(); $(this).find("span:last").remove();
} }
}
); );
$('input.multi_files').live("change", function(){ $('input.multi_files').live("change", function(){
@ -19,6 +21,8 @@ $('input.multi_files').live("change", function(){
$('a.remove_mark').live("click",function(){ $('a.remove_mark').live("click",function(){
$(this).prev("input").val("true"); $(this).prev("input").val("true");
$(this).parent().css("text-decoration","line-through") $(this).parent().css("text-decoration","line-through")
$(this).parent("li").removeClass("r_snapshot");
$(this).next("span").remove();
$(this).remove(); $(this).remove();
return false; return false;
}); });

View File

@ -58,7 +58,6 @@ class Design
object.to_save = false object.to_save = false
object.save object.save
end end
debugger
if object.to_destroy if object.to_destroy
object.destroy object.destroy
end end

View File

@ -8,7 +8,7 @@
<% object.send(fieldname_p).each do |t| %> <% object.send(fieldname_p).each do |t| %>
<% li_class += 'r_destroy ' if item_destroy %> <% li_class += 'r_destroy ' if item_destroy %>
<% li_class += 'r_snapshot ' if item_snapshot %> <% li_class += 'r_snapshot ' if item_snapshot %>
<li class="<%= li_class %>"> <%= t.file_filename %> <li class="<%= li_class %>" <%= "path='#{t.file.url}'" if item_snapshot %> > <%= t.file_filename %>
<% if item_destroy %> <% if item_destroy %>
<%=fields_for "design["+fieldname_p+"][]",t,:index=>nil do |f| %> <%=fields_for "design["+fieldname_p+"][]",t,:index=>nil do |f| %>
<%= f.hidden_field :id %> <%= f.hidden_field :id %>