Permalink
Browse files

Tweak OnDemand_tile test page and improve OnDemandList calc logic

  • Loading branch information...
1 parent 242b175 commit 632f229c0d8e7c3ef6691514057b90daf0a42a0f Kenneth G. Franqueiro committed Jul 16, 2012
Showing with 6 additions and 3 deletions.
  1. +5 −2 OnDemandList.js
  2. +1 −1 test/OnDemand_tile.html
View
7 OnDemandList.js
@@ -118,7 +118,7 @@ return declare([List, _StoreMixin], {
}
var height = 0;
for(var i = 0; i < trCount; i++){
- height += trs[i].offsetHeight;
+ height += self._calcRowHeight(trs[i]);
}
// only update rowHeight if we actually got results and are visible
if(trCount && height){ self.rowHeight = height / trCount; }
@@ -159,7 +159,10 @@ return declare([List, _StoreMixin], {
// summary:
// Calculate the height of a row. This is a method so it can be overriden for
// plugins that add connected elements to a row, like the tree
- return rowElement.offsetHeight;
+
+ var sibling = rowElement.previousSibling;
+ return sibling && sibling.offsetTop != rowElement.offsetTop ?
+ rowElement.offsetHeight : 0;
},
lastScrollTop: 0,
View
2 test/OnDemand_tile.html
@@ -15,7 +15,7 @@
}
#list .dgrid-row {
- float: left;
+ display: inline-block;
width: 100px;
height: 100px;
}

0 comments on commit 632f229

Please sign in to comment.