Permalink
Browse files

Trigger a 'collision' event when there's an collision by ids.

  • Loading branch information...
1 parent d14608b commit 4760b760787d178564a2e8e5397365aea6046fa7 @shoe shoe committed Mar 18, 2013
Showing with 3 additions and 0 deletions.
  1. +3 −0 backbone-relational.js
@@ -424,6 +424,9 @@
*/
update: function( model ) {
var coll = this.getCollection( model );
+ var other = coll.get( model );
+ if (other && other !== model)
+ model.trigger('collision', other);
coll._onModelEvent( 'change:' + model.idAttribute, model, coll );
},

0 comments on commit 4760b76

Please sign in to comment.