diff --git a/css/global.css b/css/global.css index e1e1065..5cbf0bd 100755 --- a/css/global.css +++ b/css/global.css @@ -35,8 +35,8 @@ table.basic thead.active + tbody td{ display: table-cell; } table.basic tr td, table.basic tr th, -#DRAGNDROP> td, -#DRAGNDROP> th{ +#DRAGNDROP td, +#DRAGNDROP th{ /* position */ padding: 1em 1.5em; diff --git a/js/actionScript.js b/js/actionScript.js index 376058b..7a96d04 100755 --- a/js/actionScript.js +++ b/js/actionScript.js @@ -120,8 +120,16 @@ var connected = !( DOM.AUTH.children[0].innerHTML == 'Connexion' ); DOM.SUBSECTIONS.innerHTML += "" +sections[i].title+ ""; } - selectSubSection( document.querySelector('#SUBHEADER > nav > span.active') ); - + // si dans pageManager.js, on a une sous-partie et qu'elle existe physiquement + var selectedSubSectionFromURL = document.querySelector('#SUBHEADER > nav > span[data-sectname='+pageM.vars[0]+']'); + + console.log( selectedSubSectionFromURL ); + + if( selectedSubSectionFromURL != null ) // si on trouve, on charge la sous-partie + selectSubSection( selectedSubSectionFromURL ); + else // sinon, on selectionne celle définie dans le HTML + selectSubSection( document.querySelector('#SUBHEADER > nav > span.active') ); + }, false); diff --git a/js/pageManager.js b/js/pageManager.js index df14f2a..90f0c80 100755 --- a/js/pageManager.js +++ b/js/pageManager.js @@ -141,7 +141,10 @@ pageManager.prototype = { variables associées (ne recharge aucune ressource) ======================================================================= */ updateURL: function(){ - window.history.pushState(null, this.page, '#/'+this.page+'/'+this.vars.join('/')+'/'); + if( this.vars.length > 0 ) // si il y a des variables + window.history.pushState(null, this.page, '#/'+this.page+'/'+this.vars.join('/')+'/'); + else // s'il n'y en a pas + window.history.pushState(null, this.page, '#/'+this.page+'/'); }, /* ======================================================================= @@ -201,10 +204,7 @@ pageManager.prototype = { }, 'POST', fd); // change l'URL en conséquences(stateObj, titre, url) - if( this.vars.length > 0 ) // si il y a des variables - window.history.pushState(null, this.page, '#/'+this.page+'/'+this.vars.join('/')+'/'); - else // s'il n'y en a pas - window.history.pushState(null, this.page, '#/'+this.page+'/'); + this.updateURL(); }else{ // si la page n'est pas spécifiée ou qu'elle n'est pas dans la liste des pages var urlGet = this.explodeURL(); @@ -230,10 +230,7 @@ pageManager.prototype = { }, 'POST', fd); // change l'URL en conséquences(stateObj, titre, url) - if( this.vars.length > 0 ) // si il y a des variables - window.history.pushState(null, this.page, '#/'+this.page+'/'+this.vars.join('/')+'/'); - else // s'il n'y en a pas - window.history.pushState(null, this.page, '#/'+this.page+'/'); + this.updateURL(); }else // si l'url ne contient rien, on charge la page par défaut this.setPage(this.pagelist[0]);