mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-26 08:42:41 +01:00
Fixed voting comments bug on Ponder
Summary: When user changed his mind for voting, counting does not work properly. If user vote up first and vote down, vote count must be decreased 2. fixed in javascript file Test Plan: http://cihad.phabricator.pompa.la/Q11 user : demo pass : demodemo Reviewers: aran, Korvin, epriestley Reviewed By: epriestley CC: simsekburak Differential Revision: https://secure.phabricator.com/D6446
This commit is contained in:
parent
8eef4a6c37
commit
b92acf0e5a
2 changed files with 3 additions and 1 deletions
|
@ -2282,7 +2282,7 @@ celerity_register_resource_map(array(
|
|||
),
|
||||
'javelin-behavior-ponder-votebox' =>
|
||||
array(
|
||||
'uri' => '/res/d8c973a2/rsrc/js/application/ponder/behavior-votebox.js',
|
||||
'uri' => '/res/c28daa12/rsrc/js/application/ponder/behavior-votebox.js',
|
||||
'type' => 'js',
|
||||
'requires' =>
|
||||
array(
|
||||
|
|
|
@ -16,6 +16,8 @@ JX.behavior('ponder-votebox', function(config) {
|
|||
var data = e.getNodeData('ponder-votable');
|
||||
|
||||
if (data.vote != vote) {
|
||||
// Remove the user's current vote, if they have one.
|
||||
data.count -= data.vote;
|
||||
data.vote = vote;
|
||||
data.count += vote;
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue