Commit 2ed59de150f75df63cbced4eea8725b8faa3d73b

Authored by Leonardo Merlin
1 parent 8cc28b0a

Fix #65 - Voltar a tela do programa, quando estiver em 'sobre-o-programa'

Showing 1 changed file with 10 additions and 1 deletions   Show diff stats
js/main.js
... ... @@ -89,8 +89,17 @@ $.getJSON(noosferoAPI)
89 89 $( '.proposal-category .go-back' ).click(function(event){
90 90 event.preventDefault();
91 91  
  92 + var regexSubpages = /sobre-o-programa$/;
  93 + var isSubpage = regexSubpages.exec(hash) !== null;
  94 + var newHash = '#/temas'; // default page
  95 +
  96 + if(isSubpage){
  97 + // return to proposal page
  98 + newHash = window.location.hash.split('/sobre-o-programa')[0];
  99 + }
  100 +
92 101 // Update URL and Navigate
93   - updateHash('#/temas');
  102 + updateHash(newHash);
94 103 });
95 104  
96 105 $( '.send-button a' ).click(function(event){
... ...