mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-25 11:38:49 +01:00
21 lines
No EOL
548 B
Text
21 lines
No EOL
548 B
Text
replace_project_with_edit_form();
|
|
|
|
function replace_project_with_edit_form() {
|
|
$('div#<%=dom_id(@project)%>').fadeOut(250, function() {
|
|
show_edit_form();
|
|
set_focus();
|
|
});
|
|
}
|
|
|
|
function show_edit_form() {
|
|
$('div#<%=dom_id(@project, 'edit')%>').html(html_for_edit_form());
|
|
$('div#<%=dom_id(@project, 'edit')%>').fadeIn(500);
|
|
}
|
|
|
|
function set_focus() {
|
|
$('input.project-name').focus();
|
|
}
|
|
|
|
function html_for_edit_form() {
|
|
return "<%= escape_javascript(render(:partial => 'project_form', :locals => { :project_form => @project })) %>"
|
|
} |