Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <script type="text/x-handlebars" data-template-name="gigs">
  2. <div> // code simplified
  3. {{#each controller itemController="gig"}}
  4. {{#view App.GigView contentBinding="this"}}
  5. <div class="tile">
  6. <img {{bindAttr src="photo_url"}} />
  7. {{#if widgetDisplayed}}
  8. // widget view
  9. {{/if}}
  10. </div>
  11. {{/view}}
  12. {{/each}}
  13. </div>
  14. </script>
  15.  
  16. App.GigsController = Ember.ArrayController.extend({
  17. anyWidgetDisplayed: false,
  18.  
  19. isAnyWidgetDisplayed: function() {
  20. return anyWidgetDisplayed;
  21. }
  22. });
  23.  
  24. App.GigController = Ember.ObjectController.extend({
  25. needs: ["gigs"],
  26. widgetDisplayed: false,
  27.  
  28. displayWidget: function() {
  29. console.log(controllers.gigs);
  30. if (!controllers.gigs.isAnyWidgetDisplayed) {
  31. this.set("widgetDisplayed", true);
  32. }
  33. }
  34. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement