tracks/app/views/recurring_todos/destroy.js.erb
Reinier Balt cafa774b4c refactor application.rb further and migrate recurring todos
next: get tests for recurring todos
2011-02-03 18:17:29 +01:00

22 lines
No EOL
774 B
Text

<%- if @saved -%>
show_empty_messages();
TracksPages.page_notify('notice', '<%= escape_javascript(t('todos.recurring_deleted_success') + t(:todo_removed, :count => @number_of_todos)) %>', 5);
remove_recurring_todo_from_page();
<%- else -%>
TracksPages.page_notify('error', '<%= t('todos.error_deleting_recurring', :description => @recurring_todo.description) %>', 8);
<%- end -%>
function show_empty_messages() {
<%- if @active_remaining == 0 -%>
$('#recurring-todos-empty-nd').show();
<%- end -%>
<%- if @completed_remaining == 0 -%>
$('#completed-empty-nd').show();
<%- end -%>
}
function remove_recurring_todo_from_page() {
$('#<%=dom_id(@recurring_todo)%>').slideUp(1000, function() {
$('#<%=dom_id(@recurring_todo)%>').remove();
});
}