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

Ember.View uses layout for {{yield}} helpers #14

Open
guilhermeaiolfi opened this issue Apr 17, 2012 · 2 comments
Open

Ember.View uses layout for {{yield}} helpers #14

guilhermeaiolfi opened this issue Apr 17, 2012 · 2 comments

Comments

@guilhermeaiolfi
Copy link
Contributor

Since 0.9.6 ember introduced the property "layout" to be used together with the {{yield}} helper.

It will conflict with Flame.View layout hash.

Maybe left/right/top/bottom could be set directly into Flame.View:

Flame.View.create({
    width: 100,
    height: 200
});
@ctimmerm
Copy link
Member

I'm not too sure if we want to change layout property in Flame, can you give an example of how you want to use it?
I also don't think it causes any conflicts if you're not using yield?

@guilhermeaiolfi
Copy link
Contributor Author

Yes, if I don't use the yield helper that won't cause any conflict. But I would like to be able to use it if I want to.

The concept is very interesting and could be used for themes in the future.

How I would like to use it?

Flame.View.create({
    width: 100,
    height: 200,
    top: 10,
    left: 50,
    layout: Ember.Handlebars.compile('<div class="decorator">{{yield}}</div>'),
    template: Ember.Handlebars.compile('{{content.something}}'),
    ...
});

That would create:

<div class="decorator">
      Value of content.something
</div>

It could be something much more complex other than just a div for decorator, of course. This example could be achieved with a simple classNames: [ 'decorator' ], but hopefully you get my point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants