Permalink
Browse files

Use a div.dgrid-bottom node rather than assigning a dgrid-last-row class

  • Loading branch information...
kriszyp committed Oct 31, 2011
1 parent 3c300da commit 63a01275813a125b0d9b7f2a93c924c5b3bfebac
Showing with 5 additions and 14 deletions.
  1. +3 −4 List.js
  2. +2 −5 OnDemandList.js
  3. +0 −5 css/dgrid.css
View
@@ -184,6 +184,7 @@ function(put, declare, listen, aspect, has, TouchScroll, hasClass){
this.renderHeader();
this.contentNode = put(this.bodyNode, "div.dgrid-content.ui-widget-content");
+
this._listeners.push(listen(window, "resize", function(){
grid.resize();
}));
@@ -297,6 +298,7 @@ function(put, declare, listen, aspect, has, TouchScroll, hasClass){
// remove the content so it can be recreated
this.contentNode.innerHTML = "";
+ this.bottomNode = put(this.contentNode, "div.dgrid-cell.dgrid-bottom", " ");
// remove any listeners
for(var i = 0;i < this.observers.length; i++){
this.observers[i].cancel();
@@ -353,10 +355,7 @@ function(put, declare, listen, aspect, has, TouchScroll, hasClass){
return lastRow = self.insertRow(object, rowsFragment, null, start++, options);
}
function whenDone(resolvedRows){
- (beforeNode && beforeNode.parentNode || self.contentNode).insertBefore(rowsFragment, beforeNode || null);
- if(!beforeNode){
- put(lastRow, ".dgrid-last-row");
- }
+ (beforeNode && beforeNode.parentNode || self.contentNode).insertBefore(rowsFragment, beforeNode || self.bottomNode);
return rows = resolvedRows;
}
return whenDone(rows);
View
@@ -64,13 +64,13 @@ return declare([List], {
// into view.
if(!preloadNode){
var rootQuery = true;
- var topPreloadNode = put(this.contentNode, "div.dgrid-preload");
+ var topPreloadNode = put(this.bottomNode, "-div.dgrid-preload");
topPreloadNode.preload = true;
topPreloadNode.query = query;
topPreloadNode.start = 0;
topPreloadNode.count = 0;
topPreloadNode.next =
- preloadNode = put(this.contentNode, "div.dgrid-preload");
+ preloadNode = put(this.bottomNode, "-div.dgrid-preload");
preloadNode.previous = topPreloadNode;
}
// this preload node is used to represent the area of the grid that hasn't been
@@ -108,9 +108,6 @@ return declare([List], {
if(trCount){ self.rowHeight = height / trCount; }
total -= trCount;
- if(!total && trCount && rootQuery){
- put(trs[trCount-1], ".dgrid-last-row");
- }
preloadNode.count = total;
preloadNode.start = trCount;
if(total){
View
@@ -46,7 +46,6 @@ html.has-quirks .dgrid-header-hidden .dgrid-cell {
overflow: hidden;
background-color: #eee;
}
-
.dgrid-row-table {
border-collapse: collapse;
border: none;
@@ -69,10 +68,6 @@ html.has-quirks .dgrid-header-hidden .dgrid-cell {
-webkit-box-sizing: border-box;
}
-.dgrid-last-row .dgrid-cell {
- border-bottom-style: solid;
-}
-
.dgrid-cell-padding {
padding: 3px;
}

0 comments on commit 63a0127

Please sign in to comment.