From 8fd8158840c37cc94ffa3ab840568ecaa0e61837 Mon Sep 17 00:00:00 2001 From: Carsten Otto Date: Wed, 15 Apr 2015 23:00:07 +0200 Subject: [PATCH] sort when a pending successor is activated --- app/views/todos/toggle_check.js.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/todos/toggle_check.js.erb b/app/views/todos/toggle_check.js.erb index 75543a2e..c703fde7 100644 --- a/app/views/todos/toggle_check.js.erb +++ b/app/views/todos/toggle_check.js.erb @@ -127,11 +127,15 @@ var <%= object_name %> = { if source_view_is_one_of(:project,:tag) -%> $('#<%= dom_id(t) %>').slideUp(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)%>'); <% end -%>