half way done with the new upvoting ux
This commit is contained in:
@ -113,6 +113,7 @@ $(document).ready(function() {
|
|||||||
window.location = '/challenges/' + (parseInt(l[l.length - 1]) + 1);
|
window.location = '/challenges/' + (parseInt(l[l.length - 1]) + 1);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
// Bonfire instructions functions
|
// Bonfire instructions functions
|
||||||
$('#more-info').on('click', function() {
|
$('#more-info').on('click', function() {
|
||||||
ga('send', 'event', 'Challenge', 'more-info', challengeName);
|
ga('send', 'event', 'Challenge', 'more-info', challengeName);
|
||||||
@ -125,8 +126,13 @@ $(document).ready(function() {
|
|||||||
$('#long-instructions').hide();
|
$('#long-instructions').hide();
|
||||||
});
|
});
|
||||||
|
|
||||||
var upvoteHandler = function () {
|
$('#upvote').on('click', upvoteHandler);
|
||||||
$(".ion-arrow-up-b").hide();
|
|
||||||
|
var upvoteHandler = function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
var $this = $(this);
|
||||||
|
$this.addClass('disabled');
|
||||||
|
$this.text('Upvoted!');
|
||||||
var _id = storyId;
|
var _id = storyId;
|
||||||
$('#upvote').unbind('click');
|
$('#upvote').unbind('click');
|
||||||
var alreadyUpvoted = false;
|
var alreadyUpvoted = false;
|
||||||
@ -152,7 +158,6 @@ $(document).ready(function() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$('#upvote').on('click', upvoteHandler);
|
|
||||||
|
|
||||||
var storySubmitButtonHandler = function storySubmitButtonHandler() {
|
var storySubmitButtonHandler = function storySubmitButtonHandler() {
|
||||||
|
|
||||||
|
@ -10,20 +10,10 @@
|
|||||||
.spacer
|
.spacer
|
||||||
|
|
||||||
h3.row
|
h3.row
|
||||||
.row.text-left.negative-10
|
|
||||||
.col-xs-3.col-sm-1.text-center
|
|
||||||
.row.negative-5
|
|
||||||
.col-xs-12.big-ion-up-arrow
|
|
||||||
if !hasUserVoted
|
|
||||||
a#upvote
|
|
||||||
i.ion-arrow-up-b
|
|
||||||
h3.story-up-votes
|
|
||||||
span#storyRank= rank
|
|
||||||
.col-xs-2.col-sm-1
|
.col-xs-2.col-sm-1
|
||||||
a(href="/" + author.username)
|
a(href="/" + author.username)
|
||||||
img(src="#{author.picture}", class='img-news')
|
img(src="#{author.picture}", class='img-news')
|
||||||
.col-xs-7.col-sm-10
|
.col-xs-10.col-sm-10
|
||||||
|
|
||||||
.col-xs-12.negative-28
|
.col-xs-12.negative-28
|
||||||
a(href="#{link}", target="_blank")
|
a(href="#{link}", target="_blank")
|
||||||
h3= title
|
h3= title
|
||||||
@ -40,6 +30,14 @@
|
|||||||
.negative-5
|
.negative-5
|
||||||
a#reply-to-main-post.btn.btn-no-shadow.btn-primary.btn-xs.btn-primary-ghost Reply
|
a#reply-to-main-post.btn.btn-no-shadow.btn-primary.btn-xs.btn-primary-ghost Reply
|
||||||
|  · 
|
|  · 
|
||||||
|
if !hasUserVoted
|
||||||
|
a#upvote.btn.btn-no-shadow.btn-primary.btn-xs.btn-primary-ghost
|
||||||
|
|  · 
|
||||||
|
else
|
||||||
|
a#upvote.btn.disabled.btn-no-shadow.btn-primary.btn-xs.btn-primary-ghost Upvoted!
|
||||||
|
|  · 
|
||||||
|
span#storyRank= rank + (rank > 1 ? " points" : " point")
|
||||||
|
|  · 
|
||||||
span Posted #{timeAgo}
|
span Posted #{timeAgo}
|
||||||
span  by 
|
span  by 
|
||||||
a(href="/" + author.username) @#{author.username}
|
a(href="/" + author.username) @#{author.username}
|
||||||
|
Reference in New Issue
Block a user