Last active
          December 22, 2015 18:59 
        
      - 
      
- 
        Save kennethdavidbuck/6516748 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
    
  
  
    
  | App.SwagProductDetailsView = App.BaseView.extend({ | |
| cssProperties:['width'], | |
| _selectedObserver:function(){ | |
| "use strict"; | |
| var show = this.get('current.id') === this.get('item.id'); | |
| var width = show ? '326px' : '0px'; | |
| this.setProperties({ width:width, duration:300 }); | |
| }.observes('current.id','item.id').on('didInsertElement') | |
| }); | 
  
    
      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
    
  
  
    
  | App.SwagRowController = Em.ObjectController.extend({ | |
| selected:true, | |
| currentItem:null, | |
| actions:{ | |
| selectProduct:function(product){ | |
| "use strict"; | |
| this.set('currentItem',product); | |
| } | |
| } | |
| }); | 
  
    
      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
    
  
  
    
  | App.SwagRowProductController = Em.ObjectController.extend({ | |
| selected:false, | |
| inStockLabel:Em.computed(function(){ | |
| "use strict"; | |
| return this.get('inStock') ? 'In Stock' : 'Out of Stock'; | |
| }).property('inStock') | |
| }); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment