Commit b392d232 authored by Addy Osmani's avatar Addy Osmani

Merge pull request #357 from MathieuLorber/dartM2

Application fixed for M2 of Dart
parents 002a5c28 b2c80af7
...@@ -52,9 +52,8 @@ class TodoApp { ...@@ -52,9 +52,8 @@ class TodoApp {
}); });
checkAllCheckboxElement.on.click.add((Event e) { checkAllCheckboxElement.on.click.add((Event e) {
InputElement target = e.srcElement;
for (TodoWidget todoWidget in todoWidgets) { for (TodoWidget todoWidget in todoWidgets) {
if (todoWidget.todo.completed != target.checked) { if (todoWidget.todo.completed != checkAllCheckboxElement.checked) {
todoWidget.toggle(); todoWidget.toggle();
} }
} }
...@@ -100,7 +99,7 @@ class TodoApp { ...@@ -100,7 +99,7 @@ class TodoApp {
} }
checkAllCheckboxElement.checked = (complete == todoWidgets.length); checkAllCheckboxElement.checked = (complete == todoWidgets.length);
var left = todoWidgets.length - complete; var left = todoWidgets.length - complete;
countElement.innerHTML = '<b>${left}</b> item${left != 1 ? 's' : ''} left'; countElement.innerHtml = '<b>${left}</b> item${left != 1 ? 's' : ''} left';
if (complete == 0) { if (complete == 0) {
clearCompletedElement.style.display = 'none'; clearCompletedElement.style.display = 'none';
} else { } else {
...@@ -124,6 +123,7 @@ class TodoApp { ...@@ -124,6 +123,7 @@ class TodoApp {
break; break;
default: default:
showAll(); showAll();
return;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment