From fda7524ff866ceb9bd4e1e8f15fa9dae25777859 Mon Sep 17 00:00:00 2001 From: Mitar Date: Mon, 20 Oct 2014 13:30:39 -0700 Subject: [PATCH] Default for Template.parentData set to 1. --- packages/blaze/lookup.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/blaze/lookup.js b/packages/blaze/lookup.js index aef979ca26..c1161ac25c 100644 --- a/packages/blaze/lookup.js +++ b/packages/blaze/lookup.js @@ -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');