Open msepahvand opened 11 years ago
Triggering click() again will do the job. Something like this:
$(selectors).attachVoter({ "doUpVote": function(id, value) { $this = $(this); $.post("path/to/auth/check", function(data) { if(!data.auth) { $this.trigger("click"); } }); } });
I'm trying to develop a functionality whereby i don't allow a user to vote/undo their vote (like stackoverflow.com) if they are not logged in. I'm aware that we can attach functions to upvote/downvote events but how do we force a vote to be undone? Thanks.