Commit ea0432c580342fc2a2a504673f9d42254a4b90d1
1 parent
d10e91d5
Exists in
master
and in
5 other branches
remove the 'displaySuccess' timeout message.
Showing
2 changed files
with
37 additions
and
7 deletions
Show diff stats
js/main.js
... | ... | @@ -120,9 +120,11 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers |
120 | 120 | }); |
121 | 121 | $body.off('click', '.vote-actions .vote-action'); |
122 | 122 | $body.on('click', '.vote-actions .vote-action', function(e) { |
123 | - //Helps to prevent more than one vote per proposal | |
124 | - var button = $(this); | |
125 | 123 | e.preventDefault(); |
124 | + | |
125 | + //Helps to prevent more than one vote per proposal | |
126 | + var $button = $(this); | |
127 | + var $proposal = $button.closest('.random-proposal'); | |
126 | 128 | |
127 | 129 | if(!logged_in) { |
128 | 130 | $(this).closest('.require-login-container').find('.button-send a').click(); |
... | ... | @@ -131,7 +133,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers |
131 | 133 | |
132 | 134 | if(ProposalApp.hasProposalbeenVoted(article.id)){ |
133 | 135 | // console.debug("Proposta " + article.id + " já havia sido votada"); |
134 | - Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Seu voto já foi computado nesta proposta', 800); | |
136 | + Main.displaySuccess($button.closest('.support-proposal .section-content'), 'Seu voto já foi computado nesta proposta', 800); | |
135 | 137 | contextMain.loadRandomProposal(topic_id, true); |
136 | 138 | return; |
137 | 139 | } |
... | ... | @@ -145,12 +147,35 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers |
145 | 147 | } |
146 | 148 | }).done(function(data) { |
147 | 149 | if(data.vote) { |
148 | - Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Voto realizado com sucesso', 800); | |
150 | + // Main.displaySuccess($button.closest('.support-proposal .section-content'), '', 800); | |
151 | + $proposal.find('.abstract').hide(); | |
152 | + $proposal.find('.vote-actions .like').hide(); | |
153 | + $proposal.find('.vote-actions .dislike').hide(); | |
154 | + // $proposal.find('.vote-actions .vote-result').hide(); | |
155 | + var $successPanel = $('.success-panel').clone(); | |
156 | + $successPanel.find('.icon').addClass('icon-proposal-sent'); | |
157 | + $successPanel.find('.message').html('Voto realizado com sucesso'); | |
158 | + $successPanel.removeClass('hide'); | |
159 | + $proposal.prepend($successPanel); | |
160 | + $successPanel.show(); | |
161 | + // $successPanel.css('top', Math.max(0, (($proposal.height() - $successPanel.outerHeight()) / 2) + $proposal.offset().top) + 'px'); | |
162 | + // $successPanel.css('left', Math.max(0, (($proposal.width() - $successPanel.outerWidth()) / 2) + $proposal.offset().left) + 'px'); | |
149 | 163 | } else { |
150 | - Main.displaySuccess(button.closest('.support-proposal .section-content'), 'Seu voto já foi computado nesta proposta', 800); | |
164 | + $proposal.find('.abstract').hide(); | |
165 | + $proposal.find('.vote-actions .like').hide(); | |
166 | + $proposal.find('.vote-actions .dislike').hide(); | |
167 | + | |
168 | + var $successPanel = $('.success-panel').clone(); | |
169 | + // $successPanel.find('.icon').addClass('icon-proposal-sent'); | |
170 | + $successPanel.find('.message').html('Seu voto já foi computado nesta proposta'); | |
171 | + $successPanel.removeClass('hide'); | |
172 | + $proposal.prepend($successPanel); | |
173 | + $successPanel.show(); | |
174 | + // Main.displaySuccess($button.closest('.support-proposal .section-content'), , 800); | |
175 | + // $successPanel.find('.message').html('Seu voto já foi computado nesta proposta'); | |
151 | 176 | } |
152 | - ProposalApp.addVotedProposal(article.id); | |
153 | - contextMain.loadRandomProposal(topic_id, true); | |
177 | + // ProposalApp.addVotedProposal(article.id); | |
178 | + // contextMain.loadRandomProposal(topic_id, true); | |
154 | 179 | }); |
155 | 180 | }); |
156 | 181 | ... | ... |
sass/style.sass
... | ... | @@ -1218,6 +1218,11 @@ td |
1218 | 1218 | float: left |
1219 | 1219 | margin: 10px |
1220 | 1220 | |
1221 | +// 6.22 - random proposal | |
1222 | +.random-proposal > .success-panel | |
1223 | + position: relative | |
1224 | + margin-bottom: 10px | |
1225 | + | |
1221 | 1226 | // ------------------------------------ |
1222 | 1227 | // 7 - Modificadores |
1223 | 1228 | // ------------------------------------ | ... | ... |