fixed serverside templates.js bug that prevented blocks from being defined

This commit is contained in:
psychobunny
2013-06-11 14:52:21 -04:00
parent 42e40e62d3
commit d5f3f3d9fb
2 changed files with 2 additions and 2 deletions

View File

@@ -210,7 +210,7 @@
data = template.match(regex);
if (data == null) return;
if (block !== undefined) self.blocks[block] = data[0];
if (self.blocks && block !== undefined) self.blocks[block] = data[0];
data = data[0]
.replace("<!-- BEGIN " + block + " -->", "")

View File

@@ -118,7 +118,7 @@ var express = require('express'),
console.log(posts);
res.send(
build_header() +
'\n\t<noscript>\n\t\t' + templates['noscript/topic'].parse(/*{ posts: [{ foo: 'bar' }]}*/) + '\n\t</noscript>' +
'\n\t<noscript>\n\t\t' + templates['noscript/topic'].parse({ posts: posts }) + '\n\t</noscript>' +
'\n\t<script>templates.ready(function(){ajaxify.go("topic/' + topic_url + '");});</script>' +
templates['footer']
);