Created
January 26, 2012 12:59
-
-
Save ppcano/1682657 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
| Editor.Element = Em.Object.extend({ | |
| x: 0, | |
| y:0, | |
| witdth: 0, | |
| height: 0 | |
| }); | |
| // don't forget to use set / get for access the properties of the model | |
| Editor.elements = Em.ArrayController.create({ | |
| // use pushObject or popOBject, remove Object and set the content on the property | |
| }); | |
| Editor.CollectionView = Em.CollectionView.extend({ | |
| contentBinding: Em.Binding.oneWay('Editor.elements.content'), | |
| itemViewClass: Em.View.extend({ | |
| // the content of this class will be each Editor.Element | |
| // set observes on either the content or content.x content.y content.width | |
| // and access this.$() | |
| didInsertElement: function() { | |
| // do any setup with this.$() | |
| }, | |
| template: Em.Handlebars.compile('my tetxt') | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment