mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-25 03:30:13 +01:00
21 lines
No EOL
527 B
Text
21 lines
No EOL
527 B
Text
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', :object => @context)) %>"
|
|
} |