Skip to content

Commit

Permalink
Fix event handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarno Keskikangas committed Oct 29, 2012
1 parent 5ba3b9a commit 9659547
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions examples/backbone/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $(function() {
el: $('#application'),

render: function() {
this.$('.customers').render(customers.toJSON(), {
this.$('.customers').render(this.customers.toJSON(), {
delete: {
index: function(params) { return params.index; }
}
Expand All @@ -34,7 +34,8 @@ $(function() {
this.customers.fetch();
},

addCustomer: function() {
addCustomer: function(event) {
event.preventDefault();
this.customers.create({
suffix: this.$('.new-customer .suffixes').val(),
name: this.$('.new-customer .name').val(),
Expand All @@ -44,7 +45,7 @@ $(function() {
},

deleteCustomer: function(event) {
customers.at(event.target.getAttribute('index')).destroy();
this.customers.at(event.target.getAttribute('index')).destroy();
}
});

Expand Down

0 comments on commit 9659547

Please sign in to comment.