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

@@ -59,11 +59,8 @@ define(function() {
return;
}
templates.preload_template('users', function() {
templates['users'].parse({users:[]});
var html = templates.prepare(templates['users'].blocks['users']).parse({
users: data.users
});
ajaxify.loadTemplate('users', function(usersTemplate) {
var html = templates.parse(templates.getBlock(usersTemplate, 'topics'), data);
translator.translate(html, function(translated) {
$('#users-container').html(translated);
@@ -111,11 +108,8 @@ define(function() {
}
function onUsersLoaded(users, emptyContainer) {
templates.preload_template('users', function() {
templates['users'].parse({users:[]});
var html = templates.prepare(templates['users'].blocks['users']).parse({
users: users
});
ajaxify.loadTemplate('users', function(usersTemplate) {
var html = templates.parse(templates.getBlock(usersTemplate, 'users'), {users: users});
translator.translate(html, function(translated) {
if(emptyContainer) {