Commit 8f563309 authored by Sam Saccone's avatar Sam Saccone

Remove terrible display:none Marionette hack

parent e40dcb03
...@@ -2,9 +2,3 @@ ...@@ -2,9 +2,3 @@
#todoapp.filter-completed #todo-list .active { #todoapp.filter-completed #todo-list .active {
display: none; display: none;
} }
#main,
#footer {
display: none;
}
...@@ -27,9 +27,14 @@ TodoMVC.module('TodoList', function (TodoList, App, Backbone, Marionette) { ...@@ -27,9 +27,14 @@ TodoMVC.module('TodoList', function (TodoList, App, Backbone, Marionette) {
this.showHeader(this.todoList); this.showHeader(this.todoList);
this.showFooter(this.todoList); this.showFooter(this.todoList);
this.showTodoList(this.todoList); this.showTodoList(this.todoList);
this.todoList.on('all', this.updateHiddenElements, this);
this.todoList.fetch(); this.todoList.fetch();
}, },
updateHiddenElements: function () {
$('#main, #footer').toggle(!!this.todoList.length);
},
showHeader: function (todoList) { showHeader: function (todoList) {
var header = new App.Layout.Header({ var header = new App.Layout.Header({
collection: todoList collection: todoList
......
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