From c16f27a61b66b84b5696ab7ba5dedfb4a6fd8b8a Mon Sep 17 00:00:00 2001 From: Henri Bergius Date: Thu, 3 Nov 2011 18:01:02 +0200 Subject: [PATCH] Remove non-persistent objects when leaving edit state --- src/jquery.Midgard.midgardStorage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/jquery.Midgard.midgardStorage.js b/src/jquery.Midgard.midgardStorage.js index 96acf8a..8b3d150 100644 --- a/src/jquery.Midgard.midgardStorage.js +++ b/src/jquery.Midgard.midgardStorage.js @@ -177,7 +177,7 @@ _.each(model.attributes, function(attributeValue, property) { if (attributeValue instanceof widget.vie.Collection) { attributeValue.forEach(function(model) { - if (typeof model.id === 'object') { + if (!model.id) { attributeValue.remove(model); } });