From 0cbcdc96eb05457e7635aa5d91c8f3f89e0335b3 Mon Sep 17 00:00:00 2001 From: Jeremy Ashkenas Date: Thu, 2 Feb 2012 14:09:54 -0500 Subject: [PATCH] Fixes #935. ensuring that sync is triggered on the collection after the model is removed. --- backbone.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backbone.js b/backbone.js index ceb22e5b..4743d08a 100644 --- a/backbone.js +++ b/backbone.js @@ -341,11 +341,13 @@ if (this.isNew()) return triggerDestroy(); options.success = function(resp) { + var col = model.collection; if (options.wait) triggerDestroy(); if (success) { success(model, resp); } else { model.trigger('sync', model, resp, options); + if (col) col.trigger('sync', model, resp, options); } }; options.error = Backbone.wrapError(options.error, model, options);