Sha256: 7ff36edd9e30f6f4690ed2506fdd9d63fb2342bfeb84d3cffc7c90d17fbd127d

Contents?: true

Size: 1.8 KB

Versions: 23

Compression:

Stored size: 1.8 KB

Contents

try {
<% form_selector = "#{element_form_id(:action => :update)}" %>
var action_link = ActiveScaffold.find_action_link('<%= form_selector%>');
action_link.update_flash_messages('<%=escape_javascript(render(:partial => 'messages'))%>');
<% if controller.send :successful? %>
  <% if render_parent? && controller.respond_to?(:render_component_into_view) %>
    <% parent_rendered = controller.send(:render_component_into_view, render_parent_options) %>
    <% if nested_singular_association? %>
      action_link.close('<%= escape_javascript(parent_rendered)%>');
    <% else %>
      <% if render_parent_action == :row %>
        action_link.close('<%= escape_javascript(parent_rendered)%>');
      <% elsif render_parent_action == :index %>
        <%= escape_javascript(parent_rendered) %>
      <% end %>
    <% end %>
    <%#page.call 'ActiveScaffold.replace', active_scaffold_calculations_id, render(:partial => 'list_calculations') if active_scaffold_config.list.columns.any? {|c| c.calculation?}%>
  <% elsif update_refresh_list? %>
    ActiveScaffold.replace_html('<%= active_scaffold_content_id%>', '<%= escape_javascript(render(:partial => 'list', :layout => false))%>');
   <% else %>
    <% updated_row = render :partial => 'list_record', :locals => {:record => @record}%>
    action_link.close('<%= escape_javascript(updated_row)%>');
    <% if active_scaffold_config.list.columns.any? {|c| c.calculation?}%>
      ActiveScaffold.replace('<%=active_scaffold_calculations_id%>', '<%=escape_javascript(render(:partial => 'list_calculations'))%>');
    <% end %>
  <% end %>
<% else %>
  ActiveScaffold.replace('<%=form_selector%>','<%=escape_javascript(render(:partial => 'update_form', :locals => {:xhr => true}))%>');
  ActiveScaffold.scroll_to('<%=form_selector%>');
<% end %>
} catch (e) { alert('RJS error:\n\n' + e.toString());}

Version data entries

23 entries across 23 versions & 2 rubygems

Version Path
active_scaffold-3.2.6 frontends/default/views/on_update.js.erb
active_scaffold-3.2.5 frontends/default/views/on_update.js.erb
active_scaffold-3.2.4 frontends/default/views/on_update.js.erb
active_scaffold-3.2.3 frontends/default/views/on_update.js.erb
active_scaffold-3.2.2 frontends/default/views/on_update.js.erb
active_scaffold-3.2.1 frontends/default/views/on_update.js.erb
active_scaffold-sequel-0.4.0 frontends/default/views/on_update.js.erb
active_scaffold-sequel-0.3.0 frontends/default/views/on_update.js.erb
active_scaffold-3.2.0 frontends/default/views/on_update.js.erb
active_scaffold-3.1.20 frontends/default/views/on_update.js.erb
active_scaffold-3.1.19 frontends/default/views/on_update.js.erb
active_scaffold-3.1.18 frontends/default/views/on_update.js.erb
active_scaffold-3.1.17 frontends/default/views/on_update.js.erb
active_scaffold-3.1.15 frontends/default/views/on_update.js.erb
active_scaffold-3.1.14 frontends/default/views/on_update.js.erb
active_scaffold-3.1.13 frontends/default/views/on_update.js.erb
active_scaffold-3.1.12 frontends/default/views/on_update.js.erb
active_scaffold-3.1.11 frontends/default/views/on_update.js.erb
active_scaffold-3.1.10 frontends/default/views/on_update.js.erb
active_scaffold-3.1.9 frontends/default/views/on_update.js.erb