Sha256: a629b5a04bf57fefd21c912c64fd46b4e243e1dfd9e04ad603cff618adf148f6

Contents?: true

Size: 1.76 KB

Versions: 28

Compression:

Stored size: 1.76 KB

Contents

try {
<% form_selector ||= "#{element_form_id(:action => :update, :id => @record.try(:id) || params[:id])}" %>
var action_link = ActiveScaffold.find_action_link('<%= form_selector %>');
action_link.update_flash_messages('<%= escape_javascript(render(:partial => 'messages')) %>');
<% if successful? %>
  <% if params[:dont_close] %>
    <% row_selector = element_row_id(:action => :list, :id => @record.id) %>
    ActiveScaffold.update_row('<%= row_selector %>', '<%= escape_javascript(render(:partial => 'list_record', :locals => {:record => @record})) %>');
    action_link.target = $('#<%= row_selector %>');
    <%= render :partial => 'update_calculations', :formats => [:js] %>
    <%= "ActiveScaffold.enable_form('#{form_selector}');" if params[:iframe] == 'true' %>
  <% else %>
    <% if render_parent? %>
      <% if nested_singular_association? || render_parent_action == :row %>
        action_link.close(true);
      <% else %>
        ActiveScaffold.reload('<%= url_for render_parent_options %>');
      <% end %>
    <% elsif update_refresh_list? %>
      <%= render :partial => 'refresh_list' %>
    <% else %>
      <% if @record %>
      action_link.close('<%= escape_javascript(render(:partial => 'list_record', :locals => {:record => @record})) %>');
      <% else %>
      action_link.close();
      ActiveScaffold.delete_record_row('<%= element_row_id(:action => :list, :id => params[:id]) %>');
      <% end %>
      <%= render :partial => 'update_calculations', :formats => [:js] %>
    <% end %>
  <% end %>
<% else %>
  ActiveScaffold.replace('<%= form_selector %>', '<%= escape_javascript(render(:partial => 'update_form', :locals => {:xhr => true})) %>');
  ActiveScaffold.scroll_to('<%= form_selector %>', true);
<% end %>
} catch (e) { alert('RJS error:\n\n' + e.toString());}

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
active_scaffold-3.4.35 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.34 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.33 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.32 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.31 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.30 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.29 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.28 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.27 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.26 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.25 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.24 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.23 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.22 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.21.1 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.21 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.20 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.19 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.18.1 app/views/active_scaffold_overrides/on_update.js.erb
active_scaffold-3.4.18 app/views/active_scaffold_overrides/on_update.js.erb