From f0bb70fa3a6283e628452b9a13dba462c47ecf6f Mon Sep 17 00:00:00 2001 From: psychobunny Date: Sat, 4 May 2013 06:49:57 +0000 Subject: [PATCH] adjusting rep of a user now affects all instances of that user on the page --- public/templates/topic.tpl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/public/templates/topic.tpl b/public/templates/topic.tpl index f1cb2dbdb8..7092098e49 100644 --- a/public/templates/topic.tpl +++ b/public/templates/topic.tpl @@ -11,7 +11,7 @@
- {posts.user_rep} + {posts.user_rep}
@@ -22,7 +22,7 @@
-
{posts.post_rep}
+
{posts.post_rep}
Reply
@@ -78,17 +78,17 @@ socket.on('event:new_post', function(data) { }); function adjust_rep(value, pid, uid) { - var post_rep = document.getElementById('post_rep_' + pid), - user_rep = document.getElementById('user_rep_' + uid); + var post_rep = jQuery('.post_rep_' + pid), + user_rep = jQuery('.user_rep_' + uid); - var ptotal = parseInt(post_rep.innerHTML, 10), - utotal = parseInt(user_rep.innerHTML, 10); + var ptotal = parseInt(post_rep.html(), 10), + utotal = parseInt(user_rep.html(), 10); ptotal += value; utotal += value; - post_rep.innerHTML = ptotal; - user_rep.innerHTML = utotal; + post_rep.html(ptotal); + user_rep.html(utotal); }