Permalink
Browse files

Make the insertion of the rendered fragment dependent on the existenc…

…e of the container (in case it was removed in a subsequent refresh)
  • Loading branch information...
1 parent b3ebd3c commit 7b2d21cfa590a2a2d13f6cd4b65ba672fffd1538 @kriszyp committed Feb 24, 2012
Showing with 6 additions and 3 deletions.
  1. +6 −3 List.js
View
@@ -441,9 +441,12 @@ function(kernel, declare, listen, aspect, has, TouchScroll, hasClass, put){
return lastRow;
}
function whenDone(resolvedRows){
- (beforeNode && beforeNode.parentNode || self.contentNode).insertBefore(rowsFragment, beforeNode || null);
- lastRow = resolvedRows[resolvedRows.length - 1];
- lastRow && self.adjustRowIndices(lastRow);
+ var container = beforeNode ? beforeNode.parentNode : self.contentNode;
+ if(container){
+ container.insertBefore(rowsFragment, beforeNode || null);
+ lastRow = resolvedRows[resolvedRows.length - 1];
+ lastRow && self.adjustRowIndices(lastRow);
+ }
return (rows = resolvedRows);
}
return whenDone(rows);

0 comments on commit 7b2d21c

Please sign in to comment.