Skip to content

Commit

Permalink
Merge pull request allourideas#61 from allourideas/hotfix/button-race…
Browse files Browse the repository at this point in the history
…-condition

Fix race condition with clicks on new idea
  • Loading branch information
lukebaker authored Aug 22, 2018
2 parents aad08fd + 2ab0803 commit ffaae11
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions app/views/earls/_vote_box_js.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
var newRight = newRightDiv.find('.btn-vote-idea');
var bothNew = newLeft.add(newRight);

bothNew.addClass('btn-primary').removeClass('btn-success').removeClass('disabled');
bothNew.addClass('btn-primary').removeClass('btn-success');

newLeft.html(data.newleft);
newRight.html(data.newright);
Expand All @@ -119,7 +119,9 @@
$('#right_side_text').val(data.newright);

// animation for sliding in / out choices
newLeftDiv.add(newRightDiv).slideDown();
newLeftDiv.add(newRightDiv).slideDown(function() {
bothNew.removeClass('disabled');
});
oldLeftDiv.add(oldRightDiv).slideUp(function() {
$(this).remove();
});
Expand Down

0 comments on commit ffaae11

Please sign in to comment.