Commit a63b71df authored by addyosmani's avatar addyosmani

bringing sproutcore example more in line with other examples. removing jQuery dependency

parent 37c1db6c
......@@ -172,6 +172,9 @@ body {
line-height: 1;
}
#stats-area{
display:none;
}
#create-todo {
position: relative;
}
......
......@@ -35,8 +35,9 @@
{{view Todos.CreateTodoView id="new-todo" placeholder="What needs to be done?"}}
{{/view}}
{{#view id="stats-area"}}
{{view SC.Checkbox class="mark-all-done"
title="Mark all as done"
title="Mark all as complete"
valueBinding="Todos.todosController.allAreDone"}}
{{#view id="todos"}}
......@@ -55,6 +56,8 @@
{{/view}}
{{remainingString}} left
{{/view}}
{{/view}}
</script>
</div>
......@@ -67,9 +70,6 @@
</div>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"></script>
<script>!window.jQuery && document.write(unescape('%3Cscript src="js/libs/jquery-1.6.1.min.js"%3E%3C/script%3E'))</script>
<script src="js/libs/sproutcore-2.0.a.3.min.js"></script>
<script src="js/app.js"></script>
......
......@@ -9,8 +9,12 @@ Todos.todosController = SC.ArrayProxy.create({
content: [],
createTodo: function(title) {
var todo = Todos.Todo.create({ title: title });
var todo = Todos.Todo.create({ title: title }),
stats = document.getElementById('stats-area');
this.pushObject(todo);
(stats.style.display=='block')? stats.style.display = 'inline' : stats.style.display = 'block';
},
clearCompletedTodos: function() {
......
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