From 0469a990c5547e00654f431ddbbbfb3ff215ebad Mon Sep 17 00:00:00 2001 From: Carsten Otto Date: Wed, 15 Apr 2015 23:02:52 +0200 Subject: [PATCH] sort when activating pending successors of deleted action --- app/views/todos/destroy.js.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/todos/destroy.js.erb b/app/views/todos/destroy.js.erb index 5848f716..e9f006c4 100644 --- a/app/views/todos/destroy.js.erb +++ b/app/views/todos/destroy.js.erb @@ -75,11 +75,15 @@ function activate_pending_todos() { if source_view_is_one_of(:project,:tag) -%> $('#<%= dom_id(t) %>').fadeOut(400, function() { $('#<%= dom_id(t) %>').remove(); - $('#<%= item_container_id(t) %>_items').append("<%= html %>"); + var container = $('#<%= item_container_id(t) %>_items'); + container.append("<%= html %>"); + TracksPages.sort_container(container); <%= "$('#deferred_pending_container-empty-d').show();".html_safe if @remaining_deferred_or_pending_count==0 -%> }); <% else -%> - $('#<%= item_container_id(t) %>_items').append("<%= html%>"); + var container = $('#<%= item_container_id(t) %>_items'); + container.append("<%= html%>"); + TracksPages.sort_container(container); <% end -%> TodoItems.highlight_todo('#<%= dom_id(t, 'line')%>'); <% end -%>