Commit 2326f6bc authored by Aaron Boushley's avatar Aaron Boushley

Moving towards making the clear completed button disappear when there are no completed tasks.

parent cf7f340d
...@@ -396,6 +396,10 @@ body { ...@@ -396,6 +396,10 @@ body {
border:0px; border:0px;
} }
#todoapp #todo-stats button.none-completed {
display: none;
}
/* line 136 */ /* line 136 */
#todoapp #todo-stats button:hover, #todoapp #todo-stats button:focus { #todoapp #todo-stats button:hover, #todoapp #todo-stats button:focus {
background: rgba(0, 0, 0, 0.15); background: rgba(0, 0, 0, 0.15);
......
...@@ -66,7 +66,10 @@ Todos.StatsView = Ember.View.extend({ ...@@ -66,7 +66,10 @@ Todos.StatsView = Ember.View.extend({
completedString: function() { completedString: function() {
var completed = this.get('completed'); var completed = this.get('completed');
return completed + " completed" + (completed === 1 ? " item" : " items"); return completed + " completed" + (completed === 1 ? " item" : " items");
}.property('completed') }.property('completed'),
updateCompletedButton: function () {
$('#todo-stats button').toggleClass('none-completed', this.get('completed') < 1);
}.observes('completed')
}); });
Todos.CreateTodoView = Ember.TextField.extend({ Todos.CreateTodoView = Ember.TextField.extend({
......
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