make sure partial has data before register
This commit is contained in:
parent
40292454da
commit
951fffb3eb
2 changed files with 8 additions and 2 deletions
|
@ -4,7 +4,13 @@
|
|||
$(function(){
|
||||
{% if partials %}
|
||||
{% for name, value in partials.items() %}
|
||||
Handlebars.registerPartial({{ name|tojson|safe }}, {{ value.data|tojson|safe }});
|
||||
{% if name and value %}
|
||||
try {
|
||||
Handlebars.registerPartial({{ name|tojson|safe }}, {{ value.data|tojson|safe }});
|
||||
} catch(e) {
|
||||
// no data?
|
||||
}
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
$("#start-togetherjs").click(function(){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue