Updated if helper - missed it in the last cleanup. It no longer supports methods as arguments.
This commit is contained in:
@@ -86,8 +86,7 @@ Handlebars.registerHelper('each', function(context, fn, inverse) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
Handlebars.registerHelper('if', function(context, fn, inverse) {
|
Handlebars.registerHelper('if', function(context, fn, inverse) {
|
||||||
var condition = typeof context === "function" ? context.call(this) : context;
|
if(!context || context == []) {
|
||||||
if(!condition || condition == []) {
|
|
||||||
return inverse(this);
|
return inverse(this);
|
||||||
} else {
|
} else {
|
||||||
return fn(this);
|
return fn(this);
|
||||||
|
|||||||
Reference in New Issue
Block a user