summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
Diffstat (limited to 'app/views')
-rw-r--r--app/views/common/_tabs.html.erb8
1 files changed, 7 insertions, 1 deletions
diff --git a/app/views/common/_tabs.html.erb b/app/views/common/_tabs.html.erb
index 1b880c9c7..df7513e42 100644
--- a/app/views/common/_tabs.html.erb
+++ b/app/views/common/_tabs.html.erb
@@ -1,10 +1,14 @@
+<% default_action = false %>
+
<div class="tabs">
<ul>
<% tabs.each do |tab| -%>
+ <% action = get_tab_action(tab) %>
<li><%= link_to l(tab[:label]), (tab[:url] || { :tab => tab[:name] }),
:id => "tab-#{tab[:name]}",
:class => (tab[:name] != selected_tab ? nil : 'selected'),
- :onclick => tab[:partial] ? "showTab('#{tab[:name]}', this.href); this.blur(); return false;" : nil %></li>
+ :onclick => (action.nil? ? nil : "#{ action }; return false;") %></li>
+ <% default_action = action if tab[:name] == selected_tab %>
<% end -%>
</ul>
<div class="tabs-buttons" style="display:none;">
@@ -19,3 +23,5 @@
:style => (tab[:name] != selected_tab ? 'display:none' : nil),
:class => 'tab-content') if tab[:partial] %>
<% end -%>
+
+<%= javascript_tag default_action if default_action %>