Permalink
Browse files

merge conflicts

  • Loading branch information...
2 parents e7d7948 + e523424 commit 415cc1e055082bbfb2dd3194b48afe4c2effff8e @dbecher dbecher committed Feb 18, 2011
Showing with 5 additions and 10 deletions.
  1. +1 −1 index.html
  2. +4 −9 main.js
View
@@ -71,7 +71,7 @@ <h2 id="current_task">Current Task: <span data-bind="text: first().item"></span>
<input data-bind="value: enteredTime, valueUpdate: 'afterkeydown', disable: isDone" class="enteredTime" /> /
<input data-bind="value: hours, valueUpdate: 'afterkeydown', disable: isDone" class="totalTime" />
</div>
- <span class="todo-destroy"></span>
+ <span class="todo-destroy" data-bind="click: remove"></span>
</div>
<div class="edit">
<input class="todo-input" type="text" value="" />
View
13 main.js
@@ -2,24 +2,19 @@ var id = 0;
var itemViewModel = function(options) {
options = options || {};
this.item = ko.observable(options.item || '');
- this.id = ko.observable(id++);
+ this.id = ko.observable(id++);
this.hours = ko.observable(options.hours || '');
this.enteredTime = ko.observable(options.enteredTime || 0);
this.isDone = ko.observable(options.done || false);
+ this.remove = function() {
+ viewModel.tasks.remove(this)
+ };
this.timeRemaining = ko.dependentObservable(function() {
var hours = this.hours() - this.enteredTime();
return (hours < 0) ? 0 : hours;
}, this);
}
-itemViewModel.prototype = {
- setActive: function() {
- this.container.activePage(this);
- },
- setHome: function() {
- this.container.homePage(this);
- }
-}
var taskList = function() {
this.tasks = ko.observableArray([]);

0 comments on commit 415cc1e

Please sign in to comment.