Commit d075d120 authored by Sindre Sorhus's avatar Sindre Sorhus

Backbone app: Remove moot window assignment

And double-quotes
parent 2a30629f
...@@ -13,11 +13,11 @@ var app = app || {}; ...@@ -13,11 +13,11 @@ var app = app || {};
setFilter: function( param ) { setFilter: function( param ) {
// Set the current filter to be used // Set the current filter to be used
window.app.TodoFilter = param.trim() || ''; app.TodoFilter = param.trim() || '';
// Trigger a collection filter event, causing hiding/unhiding // Trigger a collection filter event, causing hiding/unhiding
// of Todo view items // of Todo view items
window.app.Todos.trigger('filter'); app.Todos.trigger('filter');
} }
}); });
......
...@@ -32,12 +32,11 @@ $(function( $ ) { ...@@ -32,12 +32,11 @@ $(function( $ ) {
this.$footer = this.$('#footer'); this.$footer = this.$('#footer');
this.$main = this.$('#main'); this.$main = this.$('#main');
window.app.Todos.on( 'add', this.addOne, this ); app.Todos.on( 'add', this.addOne, this );
window.app.Todos.on( 'reset', this.addAll, this ); app.Todos.on( 'reset', this.addAll, this );
window.app.Todos.on('change:completed', this.filterOne, this); app.Todos.on( 'change:completed', this.filterOne, this );
window.app.Todos.on("filter", this.filterAll, this); app.Todos.on( 'filter', this.filterAll, this );
app.Todos.on( 'all', this.render, this );
window.app.Todos.on( 'all', this.render, this );
app.Todos.fetch(); app.Todos.fetch();
}, },
...@@ -83,7 +82,7 @@ $(function( $ ) { ...@@ -83,7 +82,7 @@ $(function( $ ) {
}, },
filterOne : function (todo) { filterOne : function (todo) {
todo.trigger("visible"); todo.trigger('visible');
}, },
filterAll : function () { filterAll : function () {
...@@ -112,7 +111,7 @@ $(function( $ ) { ...@@ -112,7 +111,7 @@ $(function( $ ) {
// Clear all completed todo items, destroying their models. // Clear all completed todo items, destroying their models.
clearCompleted: function() { clearCompleted: function() {
_.each( window.app.Todos.completed(), function( todo ) { _.each( app.Todos.completed(), function( todo ) {
todo.destroy(); todo.destroy();
}); });
......
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