From 98c268d9f7863aef2380d4243403a74446c5407f Mon Sep 17 00:00:00 2001 From: David Huynh Date: Thu, 1 Sep 2011 22:03:10 +0000 Subject: [PATCH] Fixed issue 38: [Wishlist] Fix the table header so that it's always visible when scrolling a long page git-svn-id: http://google-refine.googlecode.com/svn/trunk@2229 7d457c2a-affb-35e4-300a-418c747d4874 --- .../core/scripts/views/data-table/cell-ui.js | 1 + .../views/data-table/data-table-view.js | 128 ++++++++++++++---- .../core/styles/views/data-table-view.less | 38 ++++-- 3 files changed, 127 insertions(+), 40 deletions(-) diff --git a/main/webapp/modules/core/scripts/views/data-table/cell-ui.js b/main/webapp/modules/core/scripts/views/data-table/cell-ui.js index 8f1b5d6e3..5d25c38ee 100644 --- a/main/webapp/modules/core/scripts/views/data-table/cell-ui.js +++ b/main/webapp/modules/core/scripts/views/data-table/cell-ui.js @@ -532,6 +532,7 @@ DataTableCellUI.prototype._startEdit = function(elmt) { self._cell = o.cell; self._dataTableView._updateCell(self._rowIndex, self._cellIndex, self._cell); self._render(); + self._dataTableView._adjustDataTables(); } } ); diff --git a/main/webapp/modules/core/scripts/views/data-table/data-table-view.js b/main/webapp/modules/core/scripts/views/data-table/data-table-view.js index 472451f81..cd0a7ab4f 100644 --- a/main/webapp/modules/core/scripts/views/data-table/data-table-view.js +++ b/main/webapp/modules/core/scripts/views/data-table/data-table-view.js @@ -67,9 +67,13 @@ DataTableView.prototype.getSorting = function() { }; DataTableView.prototype.resize = function() { - var topHeight = this._div.find(".viewpanel-header").outerHeight(true); + this._adjustDataTables(); + + var topHeight = + this._div.find(".viewpanel-header").outerHeight(true) + + this._div.find(".data-header-table-container").outerHeight(true); var tableContainerIntendedHeight = this._div.innerHeight() - topHeight; - + var tableContainer = this._div.find(".data-table-container").css("display", "block"); var tableContainerVPadding = tableContainer.outerHeight(true) - tableContainer.height(); tableContainer.height((tableContainerIntendedHeight - tableContainerVPadding) + "px"); @@ -87,15 +91,18 @@ DataTableView.prototype.render = function() { var html = $( '
' + - '
Show as: ' + - '' + + '
Show as: ' + + '' + + '
' + + '
' + + '
' + + '
' + '
' + - '
' + - '
' + - '
' + + '
' + + '
' + '
' + - '