diff --git a/app/views/active_scaffold_overrides/_list_inline_adapter.html.erb b/app/views/active_scaffold_overrides/_list_inline_adapter.html.erb index 0cbb8e362..ee9af556b 100644 --- a/app/views/active_scaffold_overrides/_list_inline_adapter.html.erb +++ b/app/views/active_scaffold_overrides/_list_inline_adapter.html.erb @@ -1,5 +1,5 @@ <%# nested_id, allows us to remove a nested scaffold programmatically %> - + <% if successful? %>
<%= "#{nested? ? nested.name : id_from_controller(params[:controller])}-view" %> view"> @@ -9,7 +9,7 @@ <% end %> <%= javascript_tag do %> setTimeout(function() { - var action_link = ActiveScaffold.ActionLink.get('<%= element_row_id(action: :nested) %>'); + var action_link = ActiveScaffold.ActionLink.get('<%= nested_id %>'); if (action_link) { action_link.update_flash_messages('<%= escape_javascript(render('messages').strip) %>'); <% unless successful? %> diff --git a/app/views/active_scaffold_overrides/_popup_adapter.html.erb b/app/views/active_scaffold_overrides/_popup_adapter.html.erb index 308cafde2..8b918a44e 100644 --- a/app/views/active_scaffold_overrides/_popup_adapter.html.erb +++ b/app/views/active_scaffold_overrides/_popup_adapter.html.erb @@ -5,5 +5,16 @@ <%= payload -%>
<% end %> - <%= javascript_tag("setTimeout(function() { var action_link = ActiveScaffold.ActionLink.get('#{nested_id}'); if (action_link) { action_link.update_flash_messages('#{escape_javascript(render('messages').strip)}');#{' action_link.close(); ActiveScaffold.scroll_to(action_link.scaffold(), ActiveScaffold.config.scroll_on_close == "checkInViewport");' unless successful?} } }, 10);") %> + <%= javascript_tag do %> + setTimeout(function() { + var action_link = ActiveScaffold.ActionLink.get('<%= nested_id %>'); + if (action_link) { + action_link.update_flash_messages('<%= escape_javascript(render('messages').strip) %>'); + <% unless successful? %> + action_link.close(); + ActiveScaffold.scroll_to(action_link.scaffold(), ActiveScaffold.config.scroll_on_close == "checkInViewport"); + <% end %> + } + }, 10); + <% end %>