Default for Template.parentData set to 1.

This commit is contained in:
Mitar
2014-10-20 13:30:39 -07:00
parent 425ac62a1c
commit fda7524ff8

View File

@@ -128,6 +128,10 @@ Blaze.View.prototype.lookup = function (name, _options) {
// Implement Spacebars' {{../..}}.
// @param height {Number} The number of '..'s
Blaze._parentData = function (height, _functionWrapped) {
// If height is null or undefined, we default to 1, the first parent.
if (height == null) {
height = 1;
}
var theWith = Blaze.getView('with');
for (var i = 0; (i < height) && theWith; i++) {
theWith = Blaze.getView(theWith, 'with');