Skip to content

Commit

Permalink
Merge branch '3-7-stable'
Browse files Browse the repository at this point in the history
  • Loading branch information
scambra committed Dec 16, 2024
2 parents 53f4274 + 88cd3f8 commit c364ba1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%# nested_id, allows us to remove a nested scaffold programmatically %>
<tr class="inline-adapter" id="<%= element_row_id action: :nested %>">
<tr class="inline-adapter" id="<%= nested_id = element_row_id action: :nested %>">
<td class="inline-adapter-cell">
<% if successful? %>
<div class="<%= "#{params[:action]}-view" if params[:action] %> <%= "#{nested? ? nested.name : id_from_controller(params[:controller])}-view" %> view">
Expand All @@ -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? %>
Expand Down
13 changes: 12 additions & 1 deletion app/views/active_scaffold_overrides/_popup_adapter.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@
<%= payload -%>
</div>
<% 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 %>
</div>

0 comments on commit c364ba1

Please sign in to comment.