Commit 159c1afae72ae182a905ac78d6f6801414a0f5e4

Authored by Leonardo Merlin
2 parents 204606ab 6efd33cb

Merge branch 'fix-65' into 'master'

Fix 65

See merge request !15
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){
... ...