half way done with the new upvoting ux

This commit is contained in:
Michael Q Larson
2015-03-17 17:57:50 -07:00
parent f1dcb4c373
commit a52ab83757
2 changed files with 37 additions and 34 deletions

View File

@@ -113,6 +113,7 @@ $(document).ready(function() {
window.location = '/challenges/' + (parseInt(l[l.length - 1]) + 1);
});
// Bonfire instructions functions
$('#more-info').on('click', function() {
ga('send', 'event', 'Challenge', 'more-info', challengeName);
@@ -125,8 +126,13 @@ $(document).ready(function() {
$('#long-instructions').hide();
});
var upvoteHandler = function () {
$(".ion-arrow-up-b").hide();
$('#upvote').on('click', upvoteHandler);
var upvoteHandler = function (event) {
event.preventDefault();
var $this = $(this);
$this.addClass('disabled');
$this.text('Upvoted!');
var _id = storyId;
$('#upvote').unbind('click');
var alreadyUpvoted = false;
@@ -152,7 +158,6 @@ $(document).ready(function() {
});
}
};
$('#upvote').on('click', upvoteHandler);
var storySubmitButtonHandler = function storySubmitButtonHandler() {