diff --git a/app/views/common/_tabs.html.erb b/app/views/common/_tabs.html.erb
index 2cf90135f..8cbcda51a 100644
--- a/app/views/common/_tabs.html.erb
+++ b/app/views/common/_tabs.html.erb
@@ -6,7 +6,7 @@
<%= link_to l(tab[:label]), { :tab => tab[:name] },
:id => "tab-#{tab[:name]}",
:class => (tab[:name] != selected_tab ? nil : 'selected'),
- :onclick => "showTab('#{tab[:name]}'); this.blur(); return false;" %>
+ :onclick => "showTab('#{tab[:name]}', this.href); this.blur(); return false;" %>
<% end -%>
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 758a74765..46a00d09a 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -290,11 +290,16 @@ function submit_query_form(id) {
$('#'+id).submit();
}
-function showTab(name) {
+function showTab(name, url) {
$('div#content .tab-content').hide();
$('div.tabs a').removeClass('selected');
$('#tab-content-' + name).show();
$('#tab-' + name).addClass('selected');
+ //replaces current URL with the "href" attribute of the current link
+ //(only triggered if supported by browser)
+ if ("replaceState" in window.history) {
+ window.history.replaceState(null, document.title, url);
+ }
return false;
}