Make UI.parentData public

This commit is contained in:
David Greenspan
2014-08-12 13:57:33 -07:00
parent 10fe009db8
commit 28da81fd49
2 changed files with 5 additions and 5 deletions

View File

@@ -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');

View File

@@ -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();