mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 17:05:51 +01:00
remove dupe method
This commit is contained in:
@@ -36,7 +36,8 @@ define('forum/categories', ['components', 'translator', 'benchpress'], function
|
|||||||
|
|
||||||
var recentPosts = category.find('[component="category/posts"]');
|
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();
|
html.hide();
|
||||||
if (recentPosts.length === 0) {
|
if (recentPosts.length === 0) {
|
||||||
html.appendTo(category);
|
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;
|
return categories;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user