Skip to content

Commit

Permalink
Use a div.dgrid-bottom node rather than assigning a dgrid-last-row class
Browse files Browse the repository at this point in the history
  • Loading branch information
kriszyp committed Oct 31, 2011
1 parent 3c300da commit 63a0127
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 14 deletions.
7 changes: 3 additions & 4 deletions List.js
Expand Up @@ -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();
}));
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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);
Expand Down
7 changes: 2 additions & 5 deletions OnDemandList.js
Expand Up @@ -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
Expand Down Expand Up @@ -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){
Expand Down
5 changes: 0 additions & 5 deletions css/dgrid.css
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit 63a0127

Please sign in to comment.