diff --git a/www/todo/main.js b/www/todo/main.js
index 5a0025dfa..dde911b3d 100644
--- a/www/todo/main.js
+++ b/www/todo/main.js
@@ -51,11 +51,24 @@ define([
'class': 'cp-task'
}).appendTo($list);
+ var entry = APP.lm.proxy.data[el];
+
+ var $check = $('', {
+ type: 'checkbox',
+ })
+ .on('change', function (e) {
+ var checked = $check[0].checked;
+ entry.state = checked? 1: 0;
+ entry.mtime = +new Date();
+ })
+ .appendTo($taskDiv);
+ $check[0].checked = entry.state? true: false;
+
$('', { 'class': 'cp-task-text' })
- .text(APP.lm.proxy.data[el].task)
+ .text(entry.task)
.appendTo($taskDiv);
$('', { 'class': 'cp-task-date' })
- .text(new Date(APP.lm.proxy.data[el].ctime).toLocaleString())
+ .text(new Date(entry.ctime).toLocaleString())
.appendTo($taskDiv);
$('