1 <% content_for :js do %>
2 function ajaxRefreshTabPane(pane) {
3 $.ajax('<%=j url_for @object %>?tab_pane='+pane, {dataType: 'html', type: 'GET'}).
4 done(function(data, status, jqxhr) {
5 $('#' + pane + ' > div > div').html(data);
6 $(document).trigger('ajax:complete')
10 $(window).on('load', smart_scroll_fixup);
12 $(document).on('shown.bs.tab', 'ul.nav-tabs > li > a', smart_scroll_fixup);
13 $(document).on('shown.bs.tab', function(e) {
14 ajaxRefreshTabPane(e.target.id.slice(0, -4));
17 $(document).on('arv-log-event', function() {
18 ajaxRefreshTabPane($('.tab-pane.active')[0].id);
22 <% content_for :tab_panes do %>
24 <% comparable = controller.respond_to? :compare %>
26 <ul class="nav nav-tabs">
27 <% pane_list.each_with_index do |pane, i| %>
28 <li class="<%= 'active' if i==0 %>"><a href="#<%= pane %>" data-toggle="tab" id="<%= pane %>-tab"> <%= pane.gsub('_', ' ') %></a></li>
31 <div class="tab-content">
32 <% pane_list.each_with_index do |pane, i| %>
34 class="tab-pane fade <%= 'in active' if i==0 %> arv-log-event-listener"
35 <% if controller.action_name == "index" %>
36 data-object-kind="arvados#<%= ArvadosApiClient.class_kind controller.model_class %>"
38 data-object-uuid="<%= @object.uuid %>"
42 <% content_for :js do %>
44 $(document).on('ready', function() {
45 ajaxRefreshTabPane('<%=j pane %>');
50 <div class="smart-scroll" style="margin-top:0.5em;">
51 <div class="pane-content">
53 <%= render(partial: 'show_' + pane.downcase,
54 locals: { comparable: comparable, objects: @objects }) %>
56 <%= image_tag 'ajax-loader.gif' %>