forked from extern/egroupware
Fixed code for auto-reducing the grid rows, removed debug messages
This commit is contained in:
parent
7ab7b51bc8
commit
a13dfef19e
@ -28,7 +28,7 @@ var ET2_GRID_VIEW_EXT = 25;
|
||||
/**
|
||||
* Determines the timeout after which the scroll-event is processed.
|
||||
*/
|
||||
var ET2_GRID_SCROLL_TIMEOUT = 100;
|
||||
var ET2_GRID_SCROLL_TIMEOUT = 25;
|
||||
|
||||
var partitionTree = null;
|
||||
|
||||
@ -156,13 +156,11 @@ var et2_dataview_grid = Class.extend(et2_dataview_IViewRange, {
|
||||
|
||||
if (displayTop > reduceHeight)
|
||||
{
|
||||
console.log("/\\");
|
||||
this._partitionTree.reduceRange(et2_bounds(0, displayTop - reduceHeight));
|
||||
}
|
||||
|
||||
if (displayBottom + reduceHeight < this._partitionTree.getHeight())
|
||||
{
|
||||
console.log("\\/");
|
||||
this._partitionTree.reduceRange(et2_bounds(displayBottom + reduceHeight,
|
||||
this._partitionTree.getHeight()));
|
||||
}
|
||||
|
@ -129,7 +129,6 @@ var et2_dataview_gridContainer = Class.extend({
|
||||
|
||||
// Rebuild the column stylesheets
|
||||
this.columnMgr.setTotalWidth(_w - this.scrollbarWidth);
|
||||
et2_debug("log", _w - this.scrollbarWidth);
|
||||
this._updateColumns();
|
||||
}
|
||||
|
||||
@ -305,9 +304,6 @@ var et2_dataview_gridContainer = Class.extend({
|
||||
|
||||
totalWidth += col.width;
|
||||
|
||||
et2_debug("log", col.divClass, " cw: ", columnWidth, " hw: ",
|
||||
headerWidth, " tw: ", totalWidth);
|
||||
|
||||
first = false;
|
||||
}
|
||||
else
|
||||
@ -412,10 +408,6 @@ var et2_dataview_gridContainer = Class.extend({
|
||||
this.columnBorderWidth = this.constructor.prototype.columnBorderWidth =
|
||||
this._getColumnBorderWidth(clone);
|
||||
|
||||
et2_debug("log", "Scrollbar width: ", this.scrollbarWidth);
|
||||
et2_debug("log", "Header border width: ", this.headerBorderWidth);
|
||||
et2_debug("log", "Column border width: ", this.columnBorderWidth);
|
||||
|
||||
// Remove the cloned DOM-Node again from the outer body
|
||||
clone.remove();
|
||||
}
|
||||
|
@ -561,7 +561,7 @@ var et2_dataview_partitionOrganizationNode = et2_dataview_partitionNode.extend(
|
||||
* Reduces the given nodes to a single spacer
|
||||
*/
|
||||
_reduce: function(_nodes) {
|
||||
/* if (_nodes.length == 0)
|
||||
if (_nodes.length == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@ -582,7 +582,10 @@ var et2_dataview_partitionOrganizationNode = et2_dataview_partitionNode.extend(
|
||||
// Create a new spacer node and insert it at the place of the
|
||||
// first node of the range
|
||||
ph = new et2_dataview_partitionSpacerNode(this.getRoot(), 0, 0);
|
||||
this.getRoot().insertNodes(_nodes[0].getStartIndex(), [ph]);
|
||||
_nodes[0]._parent.insertNodes(_nodes[0]._pidx, [ph]);
|
||||
|
||||
// Initialize the new placeholder
|
||||
ph.initializeContainer();
|
||||
}
|
||||
|
||||
// Get the height of the resulting spacer
|
||||
@ -596,9 +599,7 @@ var et2_dataview_partitionOrganizationNode = et2_dataview_partitionNode.extend(
|
||||
}
|
||||
|
||||
// Update the spacer parameters
|
||||
et2_debug("log", "Spacer new height, count: ", height, count);
|
||||
ph.setAvgHeight(height / count);
|
||||
ph.setCount(count);
|
||||
ph.setParameters(count, height / count);
|
||||
|
||||
// Free all elements (except for the spacer)
|
||||
for (var i = _nodes.length - 1; i >= 0; i--)
|
||||
@ -607,7 +608,7 @@ var et2_dataview_partitionOrganizationNode = et2_dataview_partitionNode.extend(
|
||||
{
|
||||
_nodes[i].free();
|
||||
}
|
||||
}*/
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
|
@ -31,7 +31,9 @@ var et2_dataview_row = et2_dataview_container.extend(et2_dataview_IDataRow, {
|
||||
setIdx: function(_idx) {
|
||||
this._idx = _idx;
|
||||
|
||||
$j("div:first", this.tr).text(_idx + ":");
|
||||
$j("div:first", this.tr)
|
||||
.text(_idx + ":")
|
||||
.height((_idx % 10) * 10 + 20);
|
||||
},
|
||||
|
||||
updateData: function(_data) {
|
||||
|
Loading…
Reference in New Issue
Block a user