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) -%>