-
-
Save mixonic/6246467 to your computer and use it in GitHub Desktop.
Revisions
-
mixonic revised this gist
Aug 16, 2013 . 2 changed files with 11 additions and 10 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ <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 charactersOriginal file line number Diff line number Diff line change @@ -1,8 +1,9 @@ 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') }) -
bricker renamed this gist
Aug 16, 2013 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
bricker created this gist
Aug 16, 2013 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ <script type="text/x-handlebars" id="articles"> {{#each controller}} <figure class="img-wrapper" {{bindAttr style="view.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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ Kpcc.ArticlesView = Ember.View.extend({ imgWrapperStyle: function() { if(!this.content.get('assets.length')) return ""; var url; url = this.content.get('assets.firstObject.small.url'); return "background:url("+url+") no-repeat;background-size:cover;"; }.property('content.assets') });