2010-10-24 22:31:57 +02:00
|
|
|
replace_project_with_edit_form();
|
2010-10-08 21:07:17 +02:00
|
|
|
|
2010-10-24 22:31:57 +02:00
|
|
|
function replace_project_with_edit_form() {
|
|
|
|
|
$('div#<%=dom_id(@project)%>').fadeOut(250, function() {
|
|
|
|
|
show_edit_form();
|
|
|
|
|
set_focus();
|
2011-03-09 11:58:29 +01:00
|
|
|
enable_rich_interaction();
|
2010-10-24 22:31:57 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function show_edit_form() {
|
|
|
|
|
$('div#<%=dom_id(@project, 'edit')%>').html(html_for_edit_form());
|
2010-10-08 21:07:17 +02:00
|
|
|
$('div#<%=dom_id(@project, 'edit')%>').fadeIn(500);
|
2010-10-24 22:31:57 +02:00
|
|
|
}
|
2010-10-08 21:07:17 +02:00
|
|
|
|
2010-10-24 22:31:57 +02:00
|
|
|
function set_focus() {
|
|
|
|
|
$('input.project-name').focus();
|
|
|
|
|
}
|
2010-10-08 21:07:17 +02:00
|
|
|
|
2010-10-24 22:31:57 +02:00
|
|
|
function html_for_edit_form() {
|
2011-01-07 16:46:20 +01:00
|
|
|
return "<%= escape_javascript(render(:partial => 'project_form', :object => @project)) %>"
|
2010-10-24 22:31:57 +02:00
|
|
|
}
|