Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix typo and add checkbox.

  • Loading branch information...
commit dffaad43ae8c4152083d2c7d6665c3b8b8d86b51 1 parent a962fa0
@cmeiklejohn authored
View
4 apps/todos/resources/templates/todos.handlebars
@@ -6,6 +6,6 @@
placeholder="What needs to be done?" >
{{/view}}
-{{#collection SC.TemplateCollectionView contentBinding="Todos.todoListController"}}
- {{content.title}}
+{{#collection SC.TemplateCollectionView contentBinding="Todos.todoListController" itemClassBinding="content.isDone"}}
+ {{view Todos.MarkDoneView}}
{{/collection}}
View
7 apps/todos/todos.js
@@ -13,7 +13,7 @@ Todos.Todo = SC.Object.extend({
Todos.CreateTodoView = SC.TextField.extend({
insertNewline: function() {
- var vlaue = this.get('value');
+ var value = this.get('value');
if (value) {
Todos.todoListController.createTodo(value);
@@ -22,6 +22,11 @@ Todos.CreateTodoView = SC.TextField.extend({
}
});
+Todos.MarkDoneView = SC.Checkbox.extend({
+ titleBinding: '.parentView.content.title',
+ valueBinding: '.parentView.content.isDone'
+});
+
SC.ready(function() {
Todos.mainPane = SC.TemplatePane.append({
layerId: 'todos',
Please sign in to comment.
Something went wrong with that request. Please try again.