From e451e2ed5e6db7d0445ec98dff91ed5484a4c0fd Mon Sep 17 00:00:00 2001 From: Carsten Otto Date: Thu, 16 Apr 2015 22:15:08 +0200 Subject: [PATCH] sort after adding to existing container --- app/views/todos/_update_successful.js.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/todos/_update_successful.js.erb b/app/views/todos/_update_successful.js.erb index a180aa67..2403adb0 100644 --- a/app/views/todos/_update_successful.js.erb +++ b/app/views/todos/_update_successful.js.erb @@ -29,7 +29,9 @@ remove_todo: function(next_steps) { }); }, add_to_existing_container: function(next_steps) { - $('#<%= item_container_id(@todo) %>_items').append(<%=object_name%>.html_for_todo()); + var container = $('#<%= item_container_id(@todo) %>_items'); + container.append(<%=object_name%>.html_for_todo()); + TracksPages.sort_container(container); <% if source_view_is_one_of(:calendar) -%> next_steps.go(); <% if (@target_context_count==1) || ( (@todo.deferred? || @todo.pending?) && @remaining_deferred_or_pending_count == 1) -%>