Permalink
Browse files

Use offsetWidth to check for hidden or disconnected preload nodes, si…

…nce it is more correct (properly handles hidden nodes) and doesn't throw errors.
  • Loading branch information...
1 parent 30fd055 commit b463731f6fb120e4c09d36504eb4782bfc18cbfb @kriszyp committed Mar 16, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 OnDemandList.js
View
@@ -256,12 +256,12 @@ return declare([List, _StoreMixin], {
// the preload is below the line of sight
do{
preload = preload.previous;
- }while(preload && !preload.node.offsetParent); // skip past preloads that are not currently connected
+ }while(preload && !preload.node.offsetWidth); // skip past preloads that are not currently connected
}else if(visibleTop - mungeAmount > (preloadTop + (preloadHeight = preloadNode.offsetHeight))){
// the preload is above the line of sight
do{
preload = preload.next;
- }while(preload && !preload.node.offsetParent);// skip past preloads that are not currently connected
+ }while(preload && !preload.node.offsetWidth);// skip past preloads that are not currently connected
}else{
// the preload node is visible, or close to visible, better show it
var offset = ((preloadNode.rowIndex ? visibleTop : visibleBottom) - preloadTop) / grid.rowHeight;

0 comments on commit b463731

Please sign in to comment.