small refactorings of generated javascripts

This commit is contained in:
Reinier Balt 2014-08-10 20:43:27 +02:00
parent 8a3cb66e49
commit 6191cce4c7
33 changed files with 125 additions and 124 deletions

View file

@ -2,7 +2,7 @@
TracksPages.show_errors(html_for_error_messages());
function html_for_error_messages() {
return "<%= escape_javascript(get_list_of_error_messages_for(@project)) %>";
return "<%= js_error_messages_for(@project) %>";
}
<% else -%>
<% if @go_to_project -%>
@ -14,7 +14,7 @@
update_active_projects_container();
add_project();
clear_form();
TracksPages.page_notify('notice', "Created new project '<%= @project.name%>'", 5);
TracksPages.page_inform("Created new project '<%= @project.name%>'");
<% end -%>
/* TODO: make this generic for all pages with lists */
@ -40,7 +40,7 @@ function update_active_projects_container() {
}
function html_for_project_listing() {
return "<%= @saved ? escape_javascript(render(:partial => 'project_listing', :object => @project)) : "" %>";
return "<%= @saved ? js_render('project_listing', {}, @project) : "" %>";
}
<% end -%>