redo lost code....
This commit is contained in:
parent
a272b871e2
commit
1ac10e70a2
|
@ -1,12 +1,14 @@
|
|||
$(".r_snapshot").hover(
|
||||
$(".r_snapshot").live({
|
||||
mouseenter:
|
||||
function(){
|
||||
$(this).append($("<span></span>").html('<p class="z-preview"><img src="'+$(this).attr("path")+'"width="220" height="19" /></p>'));
|
||||
}
|
||||
,
|
||||
},
|
||||
mouseleave:
|
||||
function(){
|
||||
$(this).find("span:last").remove();
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
$('input.multi_files').live("change", function(){
|
||||
$(this).prev("ul").append("<li>"+$(this).val()+"</li>");
|
||||
|
@ -19,6 +21,8 @@ $('input.multi_files').live("change", function(){
|
|||
$('a.remove_mark').live("click",function(){
|
||||
$(this).prev("input").val("true");
|
||||
$(this).parent().css("text-decoration","line-through")
|
||||
$(this).parent("li").removeClass("r_snapshot");
|
||||
$(this).next("span").remove();
|
||||
$(this).remove();
|
||||
return false;
|
||||
});
|
||||
|
|
|
@ -58,7 +58,6 @@ class Design
|
|||
object.to_save = false
|
||||
object.save
|
||||
end
|
||||
debugger
|
||||
if object.to_destroy
|
||||
object.destroy
|
||||
end
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
<% object.send(fieldname_p).each do |t| %>
|
||||
<% li_class += 'r_destroy ' if item_destroy %>
|
||||
<% 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 %>
|
||||
<%=fields_for "design["+fieldname_p+"][]",t,:index=>nil do |f| %>
|
||||
<%= f.hidden_field :id %>
|
||||
|
|
Reference in New Issue