Skip to content

Instantly share code, notes, and snippets.

@adjohu
Created January 27, 2012 15:32
Show Gist options
  • Save adjohu/1689310 to your computer and use it in GitHub Desktop.
Save adjohu/1689310 to your computer and use it in GitHub Desktop.
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'),
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