1 <% content_for :js do %>
2 tab_pane_valid_state = {};
4 function ajaxRefreshTabPane(pane) {
5 if (!tab_pane_valid_state[pane]) {
6 tab_pane_valid_state[pane] = true;
7 $(document).trigger('ajax:send');
8 $.ajax('<%=j url_for @object %>?tab_pane='+pane, {dataType: 'html', type: 'GET'}).
9 done(function(data, status, jqxhr) {
10 $('#' + pane + ' > div > div').html(data);
11 $(document).trigger('ajax:complete');
12 ajaxRefreshTabPane(pane);
17 $(window).on('load', smart_scroll_fixup);
18 $(document).on('shown.bs.tab', 'ul.nav-tabs > li > a', smart_scroll_fixup);
20 $(document).on('shown.bs.tab', function(e) {
21 ajaxRefreshTabPane(e.target.id.slice(0, -4));
24 $(document).on('arv-log-event', function() {
25 <% pane_list.each do |pane| %>
26 tab_pane_valid_state['<%=j pane %>'] = false;
28 ajaxRefreshTabPane($('.tab-pane.active')[0].id);
32 <% content_for :tab_panes do %>
34 <% comparable = controller.respond_to? :compare %>
36 <ul class="nav nav-tabs">
37 <% pane_list.each_with_index do |pane, i| %>
38 <li class="<%= 'active' if i==0 %>"><a href="#<%= pane %>" data-toggle="tab" id="<%= pane %>-tab"> <%= pane.gsub('_', ' ') %></a></li>
41 <div class="tab-content">
42 <% pane_list.each_with_index do |pane, i| %>
44 class="tab-pane fade <%= 'in active' if i==0 %> arv-log-event-listener"
45 <% if controller.action_name == "index" %>
46 data-object-kind="arvados#<%= ArvadosApiClient.class_kind controller.model_class %>"
48 data-object-uuid="<%= @object.uuid %>"
52 <% content_for :js do %>
54 tab_pane_valid_state['<%=j pane %>'] = true;
56 tab_pane_valid_state['<%=j pane %>'] = false;
57 $(document).on('ready', function() {
58 ajaxRefreshTabPane('<%=j pane %>');
63 <div class="smart-scroll" style="margin-top:0.5em;">
64 <div class="pane-content">
66 <%= render(partial: 'show_' + pane.downcase,
67 locals: { comparable: comparable, objects: @objects }) %>
69 <%= image_tag 'ajax-loader.gif' %>