Commit 42e46b5d authored by Stas SUȘCOV's avatar Stas SUȘCOV

Cleanup todos controller.

parent e20be98e
......@@ -45,36 +45,6 @@ define('app/controllers/todos', [
checkedBinding: 'controller.allAreDone'
}),
// Todo list item view
ItemView: Ember.View.extend({
contentBinding: 'controller',
classNames: [ 'view' ],
doubleClick: function() {
this.get( 'content' ).set( 'editing', true );
}
}),
// Todo list item editing view
ItemEditor: Ember.TextField.extend({
storageBinding: 'content',
classNames: [ 'edit' ],
whenDone: function() {
this.get( 'todo' ).set( 'editing', false );
if ( !this.get( 'todo' ).get( 'title' ).trim() ) {
this.get( 'storage' ).removeObject( this.get( 'todo' ) );
}
},
focusOut: function() {
this.whenDone();
},
didInsertElement: function() {
this.$().focus();
},
insertNewline: function() {
this.whenDone();
}
}),
// Activates the views and other initializations
init: function() {
this._super();
......
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