From 1660d75205f172e610fda45f5bdb43b40ad1acdf Mon Sep 17 00:00:00 2001 From: Baris Usakli Date: Fri, 29 Nov 2013 14:18:06 -0500 Subject: [PATCH] stricter selector for human readable numbers --- public/src/app.js | 6 +++--- public/src/forum/category.js | 2 +- public/src/forum/recent.js | 2 +- public/src/forum/unread.js | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index 75270eb325..482cf0c0d1 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -297,8 +297,8 @@ var socket, }); } - app.makeNumbersHumanReadable = function(selector) { - $(selector).each(function() { + app.makeNumbersHumanReadable = function(elements) { + elements.each(function() { $(this).html(utils.makeNumberHumanReadable($(this).attr('title'))); }); } @@ -311,7 +311,7 @@ var socket, $('span.timeago').timeago(); $('.post-content img').addClass('img-responsive'); - app.makeNumbersHumanReadable('.human-readable-number'); + app.makeNumbersHumanReadable($('.human-readable-number'); app.createUserTooltips(); diff --git a/public/src/forum/category.js b/public/src/forum/category.js index c6f8d5da01..77daf9994c 100644 --- a/public/src/forum/category.js +++ b/public/src/forum/category.js @@ -143,7 +143,7 @@ define(function () { container.append(html); $('#topics-container span.timeago').timeago(); - app.makeNumbersHumanReadable('#topics-container .human-readable-number'); + app.makeNumbersHumanReadable($(html).find('.human-readable-number')); } Category.loadMoreTopics = function(cid) { diff --git a/public/src/forum/recent.js b/public/src/forum/recent.js index 437eb538c2..4614c2f404 100644 --- a/public/src/forum/recent.js +++ b/public/src/forum/recent.js @@ -91,7 +91,7 @@ define(function() { container.append(html); $('span.timeago').timeago(); - app.makeNumbersHumanReadable('#topics-container .human-readable-number'); + app.makeNumbersHumanReadable($(html).find('.human-readable-number')); } Recent.loadMoreTopics = function() { diff --git a/public/src/forum/unread.js b/public/src/forum/unread.js index ea332be0f9..60c4ba4953 100644 --- a/public/src/forum/unread.js +++ b/public/src/forum/unread.js @@ -81,7 +81,7 @@ define(function() { container.append(html); $('span.timeago').timeago(); - app.makeNumbersHumanReadable('#topics-container .human-readable-number'); + app.makeNumbersHumanReadable($(html).find('.human-readable-number')); } function loadMoreTopics() {