@@ -6,7 +6,7 | |||||
6 | <li><%= link_to l(tab[:label]), { :tab => tab[:name] }, |
|
6 | <li><%= link_to l(tab[:label]), { :tab => tab[:name] }, | |
7 | :id => "tab-#{tab[:name]}", |
|
7 | :id => "tab-#{tab[:name]}", | |
8 | :class => (tab[:name] != selected_tab ? nil : 'selected'), |
|
8 | :class => (tab[:name] != selected_tab ? nil : 'selected'), | |
9 | :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %></li> |
|
9 | :onclick => "showTab('#{tab[:name]}', this.href); this.blur(); return false;" %></li> | |
10 | <% end -%> |
|
10 | <% end -%> | |
11 | </ul> |
|
11 | </ul> | |
12 | <div class="tabs-buttons" style="display:none;"> |
|
12 | <div class="tabs-buttons" style="display:none;"> |
@@ -290,11 +290,16 function submit_query_form(id) { | |||||
290 | $('#'+id).submit(); |
|
290 | $('#'+id).submit(); | |
291 | } |
|
291 | } | |
292 |
|
292 | |||
293 | function showTab(name) { |
|
293 | function showTab(name, url) { | |
294 | $('div#content .tab-content').hide(); |
|
294 | $('div#content .tab-content').hide(); | |
295 | $('div.tabs a').removeClass('selected'); |
|
295 | $('div.tabs a').removeClass('selected'); | |
296 | $('#tab-content-' + name).show(); |
|
296 | $('#tab-content-' + name).show(); | |
297 | $('#tab-' + name).addClass('selected'); |
|
297 | $('#tab-' + name).addClass('selected'); | |
|
298 | //replaces current URL with the "href" attribute of the current link | |||
|
299 | //(only triggered if supported by browser) | |||
|
300 | if ("replaceState" in window.history) { | |||
|
301 | window.history.replaceState(null, document.title, url); | |||
|
302 | } | |||
298 | return false; |
|
303 | return false; | |
299 | } |
|
304 | } | |
300 |
|
305 |
General Comments 0
You need to be logged in to leave comments.
Login now