From a13dfef19e0b71dfa182a94331cf42e219243280 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20St=C3=B6ckel?= Date: Mon, 5 Sep 2011 09:13:58 +0000 Subject: [PATCH] Fixed code for auto-reducing the grid rows, removed debug messages --- etemplate/js/et2_dataview_view_grid.js | 4 +--- etemplate/js/et2_dataview_view_gridContainer.js | 8 -------- .../et2_dataview_view_partitionOrganizationNode.js | 13 +++++++------ etemplate/js/et2_dataview_view_row.js | 4 +++- 4 files changed, 11 insertions(+), 18 deletions(-) diff --git a/etemplate/js/et2_dataview_view_grid.js b/etemplate/js/et2_dataview_view_grid.js index 7a8c670882..e7a0ba3721 100644 --- a/etemplate/js/et2_dataview_view_grid.js +++ b/etemplate/js/et2_dataview_view_grid.js @@ -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())); } diff --git a/etemplate/js/et2_dataview_view_gridContainer.js b/etemplate/js/et2_dataview_view_gridContainer.js index 294fe10cdc..342e14b369 100644 --- a/etemplate/js/et2_dataview_view_gridContainer.js +++ b/etemplate/js/et2_dataview_view_gridContainer.js @@ -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(); } diff --git a/etemplate/js/et2_dataview_view_partitionOrganizationNode.js b/etemplate/js/et2_dataview_view_partitionOrganizationNode.js index 517e44dfd5..1962054d48 100644 --- a/etemplate/js/et2_dataview_view_partitionOrganizationNode.js +++ b/etemplate/js/et2_dataview_view_partitionOrganizationNode.js @@ -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(); } - }*/ + } }, /** diff --git a/etemplate/js/et2_dataview_view_row.js b/etemplate/js/et2_dataview_view_row.js index 15d5f64754..c8023d9573 100644 --- a/etemplate/js/et2_dataview_view_row.js +++ b/etemplate/js/et2_dataview_view_row.js @@ -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) {