got rid of all templates.prepare; pull blocks using templates.getBlock instead of parsing twice

This commit is contained in:
psychobunny
2014-03-28 13:29:51 -04:00
parent 339eafd6be
commit 7e11d29f06
11 changed files with 61 additions and 106 deletions

View File

@@ -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);