Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion release/app.js

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions release/toaster/todo_gui.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ TodoListView = (function() {
_this = this;
element = this.createElementFor(task, "#todo-template");
element.task = task;
this.taskElements.push(element);
$("#todo-list").append(element);
if (element.task.content !== "") {
this.taskElements.push(element);
$("#todo-list").prepend(element);
}
element.find(".destroy").click(function() {
return _this.deleteTaskClicked(task);
});
Expand Down
4 changes: 3 additions & 1 deletion release/toaster/todo_use_case.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ CompleteTasksUseCase = (function() {
CompleteTasksUseCase.prototype.showCompleted = function() {};

CompleteTasksUseCase.prototype.addNewTask = function(task) {
return this.todoTasks.push(task);
if (task.content !== "") {
return this.todoTasks.push(task);
}
};

CompleteTasksUseCase.prototype.editTaskContent = function(task) {};
Expand Down
6 changes: 4 additions & 2 deletions src/todo_gui.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,9 @@ class TodoListView
addNewTask: (task) =>
element = @createElementFor(task, "#todo-template")
element.task = task
@taskElements.push(element)
$("#todo-list").append(element)
if element.task.content != ""
@taskElements.push(element)
$("#todo-list").prepend(element)

element.find(".destroy").click( => @deleteTaskClicked(task))
element.find(".toggle").click( => @toggleTaskCompletionClicked(task))
Expand Down Expand Up @@ -83,6 +84,7 @@ class StatsView
showStats: (remaining, completed) =>
source = $("#stats-template").html()
template = Handlebars.compile(source)

moreThanOne = remaining > 1
data = {remaining: remaining, moreThanOne: moreThanOne, completed: completed}
html = template(data)
Expand Down
3 changes: 2 additions & 1 deletion src/todo_use_case.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ class CompleteTasksUseCase
showCompleted: =>

addNewTask: (task) =>
@todoTasks.push(task)
if task.content != ""
@todoTasks.push(task)

editTaskContent: (task) =>

Expand Down