mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-13 20:58:51 +01:00
I only modified the js that is most likely to be used in cocurrent calls. This because we start the development of Tracks 3 that will change all js.
25 lines
No EOL
799 B
Text
25 lines
No EOL
799 B
Text
<%- object_name = unique_object_name_for("edit_context_#{@context.id}") %>
|
|
|
|
var <%=object_name%> = {
|
|
animate: function() {
|
|
<%=object_name%>.replace_context_with_edit_form();
|
|
},
|
|
replace_context_with_edit_form: function() {
|
|
$('div#<%=dom_id(@context)%>').fadeOut(250, function() {
|
|
<%=object_name%>.show_edit_form();
|
|
<%=object_name%>.set_focus();
|
|
});
|
|
},
|
|
show_edit_form: function() {
|
|
$('div#<%=dom_id(@context, 'edit')%>').html(<%=object_name%>.html_for_edit_form());
|
|
$('div#<%=dom_id(@context, 'edit')%>').fadeIn(500);
|
|
},
|
|
set_focus: function() {
|
|
$('input.context-name').focus();
|
|
},
|
|
html_for_edit_form: function() {
|
|
return "<%= escape_javascript(render(:partial => 'context_form', :object => @context)) %>";
|
|
}
|
|
};
|
|
|
|
<%= object_name %>.animate(); |