-
-
Save mixonic/6246467 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/x-handlebars" id="articles"> | |
{{#each controller itemController="article"}} | |
<figure class="img-wrapper" {{bindAttr style="imgWrapperStyle"}}> | |
</figure> | |
{{/each}} | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Kpcc.ArticleController = Ember.ObjectController.extend({ | |
imgWrapperStyle: function(){ | |
var assets = this.get('assets'); | |
if (!assets.get('length')) | |
return ''; | |
var url = assets.get('firstObject.small.url'); | |
return "backgorund: url("+url+") no-repeat; background-size: cover;"; | |
}.property('assets.@each') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment