tracks/app/views/recurring_todos/update.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

22 lines
No EOL
1.1 KiB
Text

if @saved
# hide overlayed edit form
page << "TracksForm.toggle_overlay();"
# show update message
status_message = 'Recurring action saved'
status_message = 'Added new project / ' + status_message if @new_project_created
status_message = 'Added new context / ' + status_message if @new_context_created
page.notify :notice, status_message, 5.0
# update auto completer arrays for context and project
page << "contextAutoCompleter.options.array = #{context_names_for_autocomplete}; contextAutoCompleter.changed = true" if @new_context_created
page << "projectAutoCompleter.options.array = #{project_names_for_autocomplete}; projectAutoCompleter.changed = true" if @new_project_created
# replace old recurring todo with updated todo
page.replace dom_id(@recurring_todo), :partial => 'recurring_todos/recurring_todo', :locals => { :recurring_todo => @recurring_todo }
page.visual_effect :highlight, dom_id(@recurring_todo), :duration => 3
else
page.show 'edit_status'
page.replace_html 'edit_status', "#{error_messages_for('recurring_todo')}"
end