Created
January 27, 2012 16:01
-
-
Save adjohu/1689478 to your computer and use it in GitHub Desktop.
This file contains 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
Editor.ElementView = Em.View.extend({ | |
classNameBindings: ['isSelected'], | |
/* | |
isSelected: false, | |
selectedElementChanged: Em.observer(function(){ | |
var selectedElement = Editor.selectedElementController.get('content'); | |
var isSelected = selectedElement == this.get('content'); | |
this.set('isSelected', isSelected); | |
}).observes('Editor.selectedElementController.content'), | |
*/ | |
isSelected: function(){ | |
var selectedElement = Editor.selectedElementController.get('content'), | |
content = this.get('content'); | |
return selectedElement == content; | |
}.property('Editor.selectedElementController', 'content'), | |
click: function(){ | |
// Select this element on click | |
Editor.selectedElementController.set('content', this.content); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment