improve upvoting UX and start adding angular validation to submit-story view
This commit is contained in:
@@ -126,13 +126,7 @@ $(document).ready(function() {
|
||||
$('#long-instructions').hide();
|
||||
});
|
||||
|
||||
$('#upvote').on('click', upvoteHandler);
|
||||
|
||||
var upvoteHandler = function (event) {
|
||||
event.preventDefault();
|
||||
var $this = $(this);
|
||||
$this.addClass('disabled');
|
||||
$this.text('Upvoted!');
|
||||
var upvoteHandler = function () {
|
||||
var _id = storyId;
|
||||
$('#upvote').unbind('click');
|
||||
var alreadyUpvoted = false;
|
||||
@@ -154,10 +148,14 @@ $(document).ready(function() {
|
||||
$('#upvote').bind('click', upvoteHandler);
|
||||
})
|
||||
.done(function (data, textStatus, xhr) {
|
||||
$('#storyRank').text(data.rank);
|
||||
$('#upvote').text('Upvoted!').addClass('disabled');
|
||||
|
||||
$('#storyRank').text(data.rank + " points");
|
||||
});
|
||||
}
|
||||
};
|
||||
$('#upvote').on('click', upvoteHandler);
|
||||
|
||||
|
||||
var storySubmitButtonHandler = function storySubmitButtonHandler() {
|
||||
|
||||
@@ -279,6 +277,12 @@ profileValidation.controller('doneWithFirst100HoursFormController', ['$scope',
|
||||
}
|
||||
]);
|
||||
|
||||
profileValidation.controller('submitStoryController', ['$scope',
|
||||
function($scope) {
|
||||
|
||||
}
|
||||
]);
|
||||
|
||||
profileValidation.directive('uniqueUsername',['$http',function($http) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
|
||||
Reference in New Issue
Block a user