Skip to content

Instantly share code, notes, and snippets.

@jbrown
Forked from adjohu/app.js
Created January 27, 2012 15:53
Show Gist options
  • Save jbrown/1689411 to your computer and use it in GitHub Desktop.
Save jbrown/1689411 to your computer and use it in GitHub Desktop.
Editor.ElementView = Em.View.extend({
classNameBindings: ['isSelected'],
isSelected: function() {
var selectedElement = Editor.selectedElementController.get('content'),
content = this.get('content');
if(selectedElement === content) { return true; }
}.property('Editor.selectedElementController.content', 'content'),
click: function(){
// Select this element on click
Editor.selectedElementController.set('content', this.get('content'));
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment