fix #1137 for 1.7 branch. the delete warning for contexts always referenced the last context

This commit is contained in:
Reinier Balt 2011-04-14 11:16:43 +02:00
parent e1d1c6edec
commit e544e7d59f

View file

@ -19,12 +19,13 @@
<% else %>
<span class="grey">VISIBLE</span>
<% end %>
<a class="delete_context_button" href="<%= formatted_context_path(context, :js) %>" title="delete the context '<%= context.name %>'"><%= image_tag( "blank.png", :title => "Delete context", :class=>"delete_item") %></a>
<a class="delete_context_button" href="<%= formatted_context_path(context, :js) %>" title="delete the context '<%= escape_javascript(h(context.name)) %>'"><%= image_tag( "blank.png", :title => "Delete context", :class=>"delete_item") %></a>
<%= apply_behavior "a.delete_context_button:click", { :prevent_default => true, :external => true} do |page, element|
page.confirming "Are you sure that you want to delete the context \"#{escape_javascript(h(context.name))}\"? Be aware that this will also delete all (repeating) actions in this context!" do
page << "if (confirm('Are you sure that you want to ' + this.title + '" +
"? Be aware that this will also delete all (repeating) actions in this context!')) { "
element.up('.context').start_waiting
page << remote_to_href(:method => 'delete')
end
page << "} return false;"
end -%>
<a class="edit_context_button" href="#"><%= image_tag( "blank.png", :title => "Edit context", :class=>"edit_item") %></a>
<%= apply_behavior 'a.edit_context_button:click', :prevent_default => true do |page, element|