mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Moved binding of template helpers to the function.
This commit is contained in:
@@ -38,8 +38,10 @@ Blaze._getTemplateHelper = function (template, name, templateInstance) {
|
||||
var helper = template.__helpers.get(name);
|
||||
if (helper === Blaze._OLDSTYLE_HELPER) {
|
||||
isKnownOldStyleHelper = true;
|
||||
} else if (helper != null) {
|
||||
return wrapHelper(bindDataContext(helper), templateInstance);
|
||||
} else {
|
||||
return helper;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +56,9 @@ Blaze._getTemplateHelper = function (template, name, templateInstance) {
|
||||
'.helpers(...)` instead.');
|
||||
}
|
||||
}
|
||||
return template[name];
|
||||
if (template[name] != null) {
|
||||
return wrapHelper(bindDataContext(template[name]), templateInstance);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -119,7 +123,7 @@ Blaze.View.prototype.lookup = function (name, _options) {
|
||||
|
||||
} else if (template &&
|
||||
((helper = Blaze._getTemplateHelper(template, name, boundTmplInstance)) != null)) {
|
||||
return wrapHelper(bindDataContext(helper), boundTmplInstance);
|
||||
return helper;
|
||||
} else if (lookupTemplate &&
|
||||
((foundTemplate = Blaze._getTemplate(name, boundTmplInstance)) != null)) {
|
||||
return foundTemplate;
|
||||
|
||||
Reference in New Issue
Block a user