mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-19 16:50:12 +01:00
22 lines
1,018 B
Text
22 lines
1,018 B
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'
|
||
|
|
page.visual_effect :highlight, dom_id(@recurring_todo), :duration => 3
|
||
|
|
|
||
|
|
else
|
||
|
|
page.show 'error_status'
|
||
|
|
page.replace_html 'error_status', "#{error_messages_for('todo')}"
|
||
|
|
end
|