Skip to content

Commit

Permalink
Update arrayToDomNodeChildren.js
Browse files Browse the repository at this point in the history
  • Loading branch information
timtucker authored and SteveSanderson committed Feb 10, 2014
1 parent 613c3d1 commit b03affb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/binding/editDetection/arrayToDomNodeChildren.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

(function () {
// Objective:
// * Given an input array, a container DOM node, and a function from array elements to arrays of DOM nodes,
Expand All @@ -25,7 +24,7 @@

// Replace the contents of the mappedNodes array, thereby updating the record
// of which nodes would be deleted if valueToMap was itself later removed
mappedNodes.splice(0, mappedNodes.length);
mappedNodes.length = 0;
ko.utils.arrayPushAll(mappedNodes, newMappedNodes);
}, null, { disposeWhenNodeIsRemoved: containerNode, disposeWhen: function() { return !ko.utils.anyDomNodeIsAttachedToDocument(mappedNodes); } });
return { mappedNodes : mappedNodes, dependentObservable : (dependentObservable.isActive() ? dependentObservable : undefined) };
Expand Down

0 comments on commit b03affb

Please sign in to comment.