Commit 8125e6a3 authored by Stas SUȘCOV's avatar Stas SUȘCOV

Update items view bindings.

parent 8da22268
...@@ -10,7 +10,7 @@ define('app/views/items', [ ...@@ -10,7 +10,7 @@ define('app/views/items', [
*/ */
function( items_html ) { function( items_html ) {
return Ember.CollectionView.extend({ return Ember.CollectionView.extend({
contentBinding: 'controller', contentBinding: 'controller.content',
tagName: 'ul', tagName: 'ul',
elementId: 'todo-list', elementId: 'todo-list',
itemViewClass: Ember.View.extend({ itemViewClass: Ember.View.extend({
...@@ -21,14 +21,14 @@ define('app/views/items', [ ...@@ -21,14 +21,14 @@ define('app/views/items', [
this.get( 'content' ).set( 'editing', true ); this.get( 'content' ).set( 'editing', true );
}, },
removeItem: function() { removeItem: function() {
this.get( 'controller' ).removeObject( this.get( 'content' ) ); this.getPath( 'controller.content' ).removeObject( this.get( 'content' ) );
}, },
ItemEditorView: Ember.TextField.extend({ ItemEditorView: Ember.TextField.extend({
valueBinding: 'content.title', valueBinding: 'content.title',
classNames: [ 'edit' ], classNames: [ 'edit' ],
change: function() { change: function() {
if ( Ember.empty( this.getPath( 'content.title' ) ) ) { if ( Ember.empty( this.getPath( 'content.title' ) ) ) {
this.get( 'controller' ).removeObject( this.get( 'content' ) ); this.getPath( 'controller.content' ).removeObject( this.get( 'content' ) );
} }
}, },
whenDone: function() { whenDone: function() {
...@@ -44,9 +44,7 @@ define('app/views/items', [ ...@@ -44,9 +44,7 @@ define('app/views/items', [
this.whenDone(); this.whenDone();
} }
}) })
}), })
}) })
} }
); );
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment