Browse Source

- Fix the browser history management

pull/16/head
Jaussoin Timothée 11 years ago
parent
commit
74f3be085c
  1. 6
      app/widgets/Tabs/tabs.js

6
app/widgets/Tabs/tabs.js

@ -7,7 +7,6 @@ function createTabs() {
// We create the list
var html = '';
for (var i=0; i<tabs.length; i++){
//if(document.URL.search(tabs[i].id)>-1)
if(window.location.hash == '#'+tabs[i].id)
current = tabs[i].id;
@ -16,7 +15,6 @@ function createTabs() {
html += '</li>';
}
// We show the first tab
tabs[0].style.display = "block";
@ -61,7 +59,9 @@ function changeTab(current, n){
// We show the selected div
var tabOn = document.querySelector('#'+n);
tabOn.style.display = "block";
window.location.hash = n;
var baseUrl = window.location.href.split('#')[0];
window.location.replace(baseUrl + '#' + n);
scroll(0,0);
}

Loading…
Cancel
Save