Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

merge conflicts

  • Loading branch information...
commit 415cc1e055082bbfb2dd3194b48afe4c2effff8e 2 parents e7d7948 + e523424
David Becher authored February 18, 2011

Showing 2 changed files with 5 additions and 10 deletions. Show diff stats Hide diff stats

  1. 2  index.html
  2. 13  main.js
2  index.html
@@ -71,7 +71,7 @@ <h2 id="current_task">Current Task: <span data-bind="text: first().item"></span>
71 71
 								<input data-bind="value: enteredTime, valueUpdate: 'afterkeydown', disable: isDone" class="enteredTime"  /> / 
72 72
 								<input data-bind="value: hours, valueUpdate: 'afterkeydown', disable: isDone" class="totalTime"  />
73 73
               </div>
74  
-              <span class="todo-destroy"></span>
  74
+              <span class="todo-destroy" data-bind="click: remove"></span>
75 75
             </div>
76 76
             <div class="edit">
77 77
               <input class="todo-input" type="text" value="" />
13  main.js
@@ -2,24 +2,19 @@ var id = 0;
2 2
 var itemViewModel = function(options) {
3 3
 	options = options || {};
4 4
     this.item = ko.observable(options.item || '');
5  
-	this.id = ko.observable(id++);
  5
+	  this.id = ko.observable(id++);
6 6
     this.hours = ko.observable(options.hours || '');
7 7
     this.enteredTime = ko.observable(options.enteredTime || 0);
8 8
     this.isDone = ko.observable(options.done || false);
9 9
     
  10
+    this.remove = function() {
  11
+  	  viewModel.tasks.remove(this)
  12
+  	};
10 13
     this.timeRemaining = ko.dependentObservable(function() {
11 14
     	var hours = this.hours() - this.enteredTime();
12 15
 		return (hours < 0) ? 0 : hours;
13 16
 	}, this);
14 17
 }
15  
-itemViewModel.prototype = {
16  
-    setActive: function() {
17  
-      this.container.activePage(this);
18  
-    },
19  
-    setHome: function() {
20  
-      this.container.homePage(this);
21  
-    }
22  
-}
23 18
 
24 19
 var taskList = function() {
25 20
 	this.tasks = ko.observableArray([]);

0 notes on commit 415cc1e

Please sign in to comment.
Something went wrong with that request. Please try again.