Commit dd476916db1126059651c01656628286d03bee40
1 parent
5f3d362a
Exists in
master
and in
5 other branches
Fix vote
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
js/main.js
| ... | ... | @@ -102,16 +102,16 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
| 102 | 102 | //Helps to prevent more than one vote per proposal |
| 103 | 103 | var button = $(this); |
| 104 | 104 | |
| 105 | - if(ProposalApp.hasProposalbeenVoted(article.id)){ | |
| 106 | - console.log("Proposta " + article.id + " já havia sido votada"); | |
| 107 | - Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Voto realizado com sucesso', 800); | |
| 108 | - contextMain.loadRandomProposal(topic_id); | |
| 105 | + if(!logged_in) { | |
| 106 | + $(this).closest('.require-login-container').find('.button-send a').click(); | |
| 109 | 107 | e.preventDefault(); |
| 110 | 108 | return; |
| 111 | 109 | } |
| 112 | 110 | |
| 113 | - if(!logged_in) { | |
| 114 | - $(this).closest('.require-login-container').find('.button-send a').click(); | |
| 111 | + if(ProposalApp.hasProposalbeenVoted(article.id)){ | |
| 112 | + console.log("Proposta " + article.id + " já havia sido votada"); | |
| 113 | + Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Voto realizado com sucesso', 800); | |
| 114 | + contextMain.loadRandomProposal(topic_id); | |
| 115 | 115 | e.preventDefault(); |
| 116 | 116 | return; |
| 117 | 117 | } | ... | ... |