Skip to content

Node.js based forum software built for the modern web

remove dupe method

Baris Usakli14fbc0dc2f73
diff --git a/public/src/client/categories.js b/public/src/client/categories.js
index 8357ff8a29..779710fcbb 100644
--- a/public/src/client/categories.js
+++ b/public/src/client/categories.js
@@ -36,7 +36,8 @@ define('forum/categories', ['components', 'translator', 'benchpress'], function
var recentPosts = category.find('[component="category/posts"]');
- parseAndTranslate([post], function (html) {
+ app.parseAndTranslate('partials/categories/lastpost', 'posts', { posts: [post] }, function (html) {
+ html.find('.post-content img:not(.not-responsive)').addClass('img-responsive');
html.hide();
if (recentPosts.length === 0) {
html.appendTo(category);
@@ -57,16 +58,5 @@ define('forum/categories', ['components', 'translator', 'benchpress'], function
});
}
- function parseAndTranslate(posts, callback) {
- Benchpress.parse('partials/categories/lastpost', 'posts', { posts: posts }, function (html) {
- translator.translate(html, function (translatedHTML) {
- translatedHTML = $(translatedHTML);
- translatedHTML.find('.post-content img:not(.not-responsive)').addClass('img-responsive');
-
- callback(translatedHTML);
- });
- });
- }
-
return categories;
});