From 28da81fd49c923978510ae603d86fd238c04e08d Mon Sep 17 00:00:00 2001 From: David Greenspan Date: Tue, 12 Aug 2014 13:57:33 -0700 Subject: [PATCH] Make UI.parentData public --- packages/blaze/lookup.js | 4 ++-- packages/spacebars-tests/template_tests.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/blaze/lookup.js b/packages/blaze/lookup.js index b70c11d9e6..ef6f5c3b6b 100644 --- a/packages/blaze/lookup.js +++ b/packages/blaze/lookup.js @@ -55,7 +55,7 @@ Blaze.View.prototype.lookup = function (name, _options) { if (!/^(\.)+$/.test(name)) throw new Error("id starting with dot must be a series of dots"); - return Blaze._parentData(name.length - 1, true /*_functionWrapped*/); + return Blaze.parentData(name.length - 1, true /*_functionWrapped*/); } else if (template && (name in template)) { return wrapHelper(bindDataContext(template[name])); @@ -91,7 +91,7 @@ Blaze.View.prototype.lookup = function (name, _options) { // Implement Spacebars' {{../..}}. // @param height {Number} The number of '..'s -Blaze._parentData = function (height, _functionWrapped) { +Blaze.parentData = function (height, _functionWrapped) { var theWith = Blaze.getCurrentView('with'); for (var i = 0; (i < height) && theWith; i++) { theWith = Blaze.getParentView(theWith, 'with'); diff --git a/packages/spacebars-tests/template_tests.js b/packages/spacebars-tests/template_tests.js index b5824c899e..b855943a41 100644 --- a/packages/spacebars-tests/template_tests.js +++ b/packages/spacebars-tests/template_tests.js @@ -2257,7 +2257,7 @@ Tinytest.add( ); Tinytest.add( - "spacebars-tests - template_tests - UI._parentData from helpers", + "spacebars-tests - template_tests - UI.parentData from helpers", function (test) { var childTmpl = Template.spacebars_test_template_parent_data_helper_child; var parentTmpl = Template.spacebars_test_template_parent_data_helper; @@ -2270,7 +2270,7 @@ Tinytest.add( childTmpl.c = ["c"]; childTmpl.foo = function () { - return UI._parentData(height.get()); + return UI.parentData(height.get()); }; var div = renderToDiv(parentTmpl); @@ -2280,7 +2280,7 @@ Tinytest.add( Deps.flush(); test.equal(canonicalizeHtml(div.innerHTML), "bar"); - // Test UI._parentData() reactivity + // Test UI.parentData() reactivity bar.set("baz"); Deps.flush();