2011-11-22 22:20:28 -06:00
|
|
|
function html_for_edit_form() {
|
|
|
|
|
return "<%= escape_javascript(render(:partial => 'project_form', :object => @project)) %>";
|
|
|
|
|
}
|
2010-10-08 21:07:17 +02:00
|
|
|
|
2011-11-22 22:20:28 -06:00
|
|
|
function remove_edit_form() {
|
|
|
|
|
$('div#<%= dom_id(@project, 'edit') %>').fadeOut(250, function() {
|
|
|
|
|
$('div#<%= dom_id(@project) %>').fadeIn(250);
|
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);
|
2011-12-02 22:15:36 -06:00
|
|
|
$('div#project_name').editable('disable');
|
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
|
|
|
|
2011-11-22 22:20:28 -06:00
|
|
|
|
|
|
|
|
function replace_project_with_edit_form() {
|
|
|
|
|
$('div#<%=dom_id(@project)%>').fadeOut(250, function() {
|
|
|
|
|
show_edit_form();
|
|
|
|
|
set_focus();
|
|
|
|
|
enable_rich_interaction();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
replace_project_with_edit_form();
|