diff --git a/TODO.md b/TODO.md index 13ca3de90..2d318b9d9 100644 --- a/TODO.md +++ b/TODO.md @@ -4,4 +4,5 @@ - select scope to defineProperty on based on path, create object if needed - when a new object is set, recursively replace all properties with getter/setters that emit events. - sd-with -- standarized way to reuse components (sd-component?) \ No newline at end of file +- standarized way to reuse components (sd-component?) +- plugins: seed-touch, seed-storage, seed-router \ No newline at end of file diff --git a/examples/todos/app.js b/examples/todos/app.js index 4749b781f..adeb04033 100644 --- a/examples/todos/app.js +++ b/examples/todos/app.js @@ -28,9 +28,17 @@ Seed.controller('Todos', function (scope) { return scope.remaining > 1 ? 'items' : 'item' }} - scope.allDone = {get: function () { - return scope.remaining === 0 - }} + scope.allDone = { + get: function () { + return scope.remaining === 0 + }, + set: function (value) { + scope.todos.forEach(function (todo) { + todo.done = value + }) + scope.remaining = value ? 0 : scope.total + } + } // event handlers --------------------------------------------------------- scope.addTodo = function (e) { @@ -62,13 +70,6 @@ Seed.controller('Todos', function (scope) { scope.filter = e.el.dataset.filter } - scope.toggleAll = function (e) { - scope.todos.forEach(function (todo) { - todo.done = e.el.checked - }) - scope.remaining = e.el.checked ? 0 : scope.total - } - scope.removeCompleted = function () { scope.todos = scope.todos.filter(function (todo) { return !todo.done diff --git a/examples/todos/index.html b/examples/todos/index.html index cb3651cdb..1af8d8cf2 100644 --- a/examples/todos/index.html +++ b/examples/todos/index.html @@ -25,8 +25,7 @@