##// END OF EJS Templates
Update URL when changing tab (#13900)....
Jean-Baptiste Barth -
r11535:501007f01d0d
parent child
Show More
@@ -6,7 +6,7
6 6 <li><%= link_to l(tab[:label]), { :tab => tab[:name] },
7 7 :id => "tab-#{tab[:name]}",
8 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 10 <% end -%>
11 11 </ul>
12 12 <div class="tabs-buttons" style="display:none;">
@@ -290,11 +290,16 function submit_query_form(id) {
290 290 $('#'+id).submit();
291 291 }
292 292
293 function showTab(name) {
293 function showTab(name, url) {
294 294 $('div#content .tab-content').hide();
295 295 $('div.tabs a').removeClass('selected');
296 296 $('#tab-content-' + name).show();
297 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 303 return false;
299 304 }
300 305
General Comments 0
You need to be logged in to leave comments. Login now