Guest User

Untitled

a guest
Jul 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. ##core
  2.  
  3. SC.Binding.firstObject = function() {
  4. return this.transform(function(value, isForward) {
  5. if (value && value.isEnumerable) {
  6. value = value.firstObject();
  7. }
  8. return value;
  9. });
  10. } ;
  11.  
  12. SC.Binding.property = function(key) {
  13. return this.transform(function(value, isForward) {
  14. if (value && value.get(key)) {
  15. value = value.get(key);
  16. }
  17. return value;
  18. });
  19. };
  20.  
  21. ## controllers/projects
  22.  
  23. contentBinding: 'Ras.clientsController.selection',
  24. contentBindingDefault: SC.Binding.firstObject().property('projects'),
  25.  
  26. contentHasChanged: function() {
  27. this.selectObject(this.get('firstObject'));
  28. }.observes('content')
Add Comment
Please, Sign In to add comment