tracks/app/views/recurring_todos/toggle_check.js.rjs
Reinier Balt 198f3240b8 fix several deprecation warnings
truncate wants explicit :length => number and :omission
calling a partial from a js requires to explicitly pass the variable i.e. :todo => @todo instead of rails doing it implicitly
2008-11-30 20:16:57 +01:00

30 lines
No EOL
1.3 KiB
Text

if @saved
page[@recurring_todo].remove
page['badge_count'].replace_html @count
if @recurring_todo.completed?
# show completed recurring todo
page.insert_html :top, "completed_recurring_todos_container", :partial => 'recurring_todos/recurring_todo', :locals => { :recurring_todo => @recurring_todo }
page.visual_effect :highlight, dom_id(@recurring_todo), :duration => 3
# set empty messages
page.show 'recurring-todos-empty-nd' if @remaining == 0
page.hide 'completed-empty-nd'
else
# recurring_todo is activated
# show completed recurring todo
page.insert_html :top, "recurring_todos_container", :partial => 'recurring_todos/recurring_todo', :locals => { :recurring_todo => @recurring_todo }
page.visual_effect :highlight, dom_id(@recurring_todo), :duration => 3
# inform user if a new todo has been created because of the activation
page.notify :notice, "A new todo was added which belongs to this recurring todo", 3.0 unless @new_recurring_todo.nil?
# set empty messages
page.show 'completed-empty-nd' if @remaining == 0
page.hide 'recurring-todos-empty-nd'
end
else
page.notify :error, "There was an error completing / activating the recurring todo #{@recurring_todo.description}", 8.0
end