diff --git a/public/src/forum/account.js b/public/src/forum/account.js index 0d56ffbc9a..aba3eb33a1 100644 --- a/public/src/forum/account.js +++ b/public/src/forum/account.js @@ -5,11 +5,7 @@ $(document).ready(function() { - var rep = $('#reputation'); - rep.html(app.addCommas(rep.html())); - - var postcount = $('#postcount'); - postcount.html(app.addCommas(postcount.html())); + app.addCommasToNumbers(); var followBtn = $('#follow-btn'); var unfollowBtn = $('#unfollow-btn'); diff --git a/public/src/forum/followers.js b/public/src/forum/followers.js index d5ad575f02..5e4ec7a00d 100644 --- a/public/src/forum/followers.js +++ b/public/src/forum/followers.js @@ -10,13 +10,7 @@ $('#no-followers-notice').show(); } - $('.reputation').each(function(index, element) { - $(element).html(app.addCommas($(element).html())); - }); - - $('.postcount').each(function(index, element) { - $(element).html(app.addCommas($(element).html())); - }); + app.addCommasToNumbers(); }); diff --git a/public/src/forum/following.js b/public/src/forum/following.js index dfeec84c3f..836fc274ca 100644 --- a/public/src/forum/following.js +++ b/public/src/forum/following.js @@ -32,14 +32,7 @@ }); } - $('.reputation').each(function(index, element) { - $(element).html(app.addCommas($(element).html())); - }); - - $('.postcount').each(function(index, element) { - $(element).html(app.addCommas($(element).html())); - }); - + app.addCommasToNumbers(); }); diff --git a/public/src/forum/users.js b/public/src/forum/users.js index 74283a3467..8a6eae77cd 100644 --- a/public/src/forum/users.js +++ b/public/src/forum/users.js @@ -8,6 +8,8 @@ parts = url.split('/'), active = parts[parts.length-1]; + app.addCommasToNumbers(); + jQuery('.nav-pills li').removeClass('active'); jQuery('.nav-pills li a').each(function() { if (this.getAttribute('href').match(active)) { @@ -67,13 +69,7 @@ }); - $('.reputation').each(function(index, element) { - $(element).html(app.addCommas($(element).html())); - }); - $('.postcount').each(function(index, element) { - $(element).html(app.addCommas($(element).html())); - }); function onUsersLoaded(users) { var html = templates.prepare(templates['users'].blocks['users']).parse({ users: users }); diff --git a/public/templates/account.tpl b/public/templates/account.tpl index 7d69bb4679..0a64875a43 100644 --- a/public/templates/account.tpl +++ b/public/templates/account.tpl @@ -34,7 +34,6 @@