Make {{#if foo}} handle empty Arrays
This commit is contained in:
@@ -91,7 +91,7 @@ Handlebars.registerHelper('each', function(context, fn, inverse) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Handlebars.registerHelper('if', function(context, fn, inverse) {
|
Handlebars.registerHelper('if', function(context, fn, inverse) {
|
||||||
if(context === false || context == null) {
|
if(!context || context === []) {
|
||||||
return inverse(this);
|
return inverse(this);
|
||||||
} else {
|
} else {
|
||||||
return fn(this);
|
return fn(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user