migrate editing a context and refactor project with it

This commit is contained in:
Reinier Balt 2010-10-24 22:31:57 +02:00
parent 4e9777dc88
commit fb39d841a7
13 changed files with 163 additions and 43 deletions

View file

@ -0,0 +1,21 @@
replace_context_with_edit_form();
function replace_context_with_edit_form() {
$('div#<%=dom_id(@context)%>').fadeOut(250, function() {
show_edit_form();
set_focus();
});
}
function show_edit_form() {
$('div#<%=dom_id(@context, 'edit')%>').html(html_for_edit_form());
$('div#<%=dom_id(@context, 'edit')%>').fadeIn(500);
}
function set_focus() {
$('input.context-name').focus();
}
function html_for_edit_form() {
return "<%= escape_javascript(render(:partial => 'context_form', :locals => { :context_form => @context })) %>"
}