Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUGFIX release] Fix nested simple bindings inside of nested yields within views #10493

Merged
merged 1 commit into from
Feb 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ember-htmlbars/lib/helpers/yield.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,5 @@ export function yieldHelper(params, hash, options, env) {

Ember.assert("You called yield in a template that was not a layout", !!view);

return view._yield(null, env, options.morph, params);
return view._yield(this, env, options.morph, params);
}
2 changes: 1 addition & 1 deletion packages/ember-htmlbars/lib/hooks/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default function content(env, morph, view, path) {
}

if (isStream(result)) {
appendSimpleBoundView(env.data.view, morph, result);
appendSimpleBoundView(view, morph, result);
} else {
morph.setContent(result);
}
Expand Down
13 changes: 13 additions & 0 deletions packages/ember-htmlbars/tests/helpers/yield_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,19 @@ QUnit.test("simple bindings inside of a yielded template should work properly wh
equal(view.$().text(), "ohai");
});

QUnit.test("nested simple bindings inside of a yielded template should work properly when the yield is nested inside of another view", function() {
view = EmberView.create({
layout: compile('{{#if view.falsy}}{{else}}{{yield}}{{/if}}'),
template: compile("{{#if view.falsy}}{{else}}{{view.text}}{{/if}}"),
text: "ohai"
});

run(function() {
view.createElement();
});

equal(view.$().text(), "ohai");
});

QUnit.module("ember-htmlbars: Component {{yield}}", {
setup: function() {},
Expand Down
2 changes: 1 addition & 1 deletion packages/ember-views/lib/views/view.js
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ var View = CoreView.extend(

if (template) {
if (template.isHTMLBars) {
return template.render(this, options, morph.contextualElement);
return template.render(context, options, morph.contextualElement);
} else {
return template(context, options);
}
Expand Down