mirror of
https://github.com/TracksApp/tracks.git
synced 2025-09-22 05:50:47 +02:00
25 lines
No EOL
536 B
Text
25 lines
No EOL
536 B
Text
<% if @saved -%>
|
|
TracksPages.hide_errors();
|
|
add_note();
|
|
clear_form();
|
|
<% else -%>
|
|
TracksPages.show_errors(html_for_error_messages());
|
|
<% end -%>
|
|
|
|
function add_note() {
|
|
$('div#notes').append(html_for_note_summary());
|
|
$('#empty-n').hide();
|
|
}
|
|
|
|
function clear_form() {
|
|
$('#new-note').hide();
|
|
$('#edit-note-form').clearForm();
|
|
}
|
|
|
|
function html_for_error_messages() {
|
|
return "<%= js_error_messages_for(@note) %>";
|
|
}
|
|
|
|
function html_for_note_summary() {
|
|
return "<%= @saved ? js_render('notes_summary', {}, @note) : "" %>";
|
|
} |