mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-17 22:10:23 +01:00
got rid of all templates.prepare; pull blocks using templates.getBlock instead of parsing twice
This commit is contained in:
@@ -746,14 +746,12 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
|
||||
}
|
||||
|
||||
function parseAndTranslatePosts(data, callback) {
|
||||
templates.preload_template('topic', function() {
|
||||
templates.topic.parse({posts: []});
|
||||
var html = templates.prepare(templates.topic.blocks.posts).parse(data);
|
||||
ajaxify.loadTemplate('topic', function(topicTemplate) {
|
||||
var html = templates.parse(templates.getBlock(topicTemplate, 'posts'), data);
|
||||
translator.translate(html, callback);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function onNewPostsLoaded(html, posts) {
|
||||
for (var x = 0, numPosts = posts.length; x < numPosts; x++) {
|
||||
toggle_mod_tools(posts[x].pid, posts[x].display_moderator_tools);
|
||||
|
||||
Reference in New Issue
Block a user