Index: app/views/common/_tabs.html.erb
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/views/common/_tabs.html.erb (revision e1ff7c18481cd730e461026c31801a7d7f2039ac)
+++ app/views/common/_tabs.html.erb (revision )
@@ -1,10 +1,14 @@
+<% default_action = false %>
+
<% tabs.each do |tab| -%>
+ <% action = tab[:onclick] ? tab[:onclick] : (tab[:partial] ? "showTab('#{tab[:name]}', this.href)" : nil) %>
- <%= 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 %>
+ :onclick => action ? "#{action}; this.blur(); return false;" : nil %>
+ <% default_action = action if tab[:name] == selected_tab %>
<% end -%>
@@ -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 %>
\ No newline at end of file