ampersand-collection
Advanced tools
Comparing version 1.3.0 to 1.3.1
@@ -85,3 +85,3 @@ var BackboneEvents = require('backbone-events-standalone'); | ||
if (existing = this.get(id)) { | ||
if (remove) modelMap[existing.cid] = true; | ||
if (remove) modelMap[existing.cid || existing.id] = true; | ||
if (merge) { | ||
@@ -119,3 +119,4 @@ attrs = attrs === model ? model.attributes : attrs; | ||
for (i = 0, length = this.length; i < length; i++) { | ||
if (!modelMap[(model = this.models[i]).cid]) toRemove.push(model); | ||
model = this.models[i]; | ||
if (!modelMap[model.cid || model.id]) toRemove.push(model); | ||
} | ||
@@ -128,3 +129,2 @@ if (toRemove.length) this.remove(toRemove, options); | ||
if (sortable) sort = true; | ||
this.length += toAdd.length; | ||
if (at != null) { | ||
@@ -135,3 +135,2 @@ for (i = 0, length = toAdd.length; i < length; i++) { | ||
} else { | ||
if (order) this.models.length = 0; | ||
var orderedModels = order || toAdd; | ||
@@ -272,3 +271,3 @@ for (i = 0, length = orderedModels.length; i < length; i++) { | ||
for (var name in this._indexes) { | ||
delete this._indexes[name][model[name] || model.get(name)]; | ||
delete this._indexes[name][model[name] || (model.get && model.get(name))]; | ||
} | ||
@@ -275,0 +274,0 @@ }, |
{ | ||
"name": "ampersand-collection", | ||
"version": "1.3.0", | ||
"version": "1.3.1", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -5,0 +5,0 @@ "bugs": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
22866
508