<% content_for :tab_panes do %> <% comparable = controller.respond_to? :compare %>
<% pane_list.each_with_index do |pane, i| %>
<% content_for :js do %> $(document).on('<%= 'ready' if i != 0 %> arv-log-event', function() { $.ajax('<%= url_for @object %>?tab_pane=<%= pane %>', {dataType: 'html', type: 'GET'}). done(function(data, status, jqxhr) { $('#<%= pane %> > div > div').html(data); }). fail(function(jqxhr, status, error) { }); }); <% end %>
<% if i == 0 %> <%= render(partial: 'show_' + pane.downcase, locals: { comparable: comparable, objects: @objects }) %> <% else %> <%= image_tag 'ajax-loader.gif' %> <% end %>
<% end %>
<% end %> <% content_for :js do %> $(window).on('load', smart_scroll_fixup); $(document).on('shown.bs.tab', 'ul.nav-tabs > li > a', smart_scroll_fixup); <% end %>