mirror of
https://github.com/meteor/meteor.git
synced 2026-05-02 03:01:46 -04:00
Make UI.parentData public
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user