From da55033df387aa47568a8ab01f4e6661372b1d5e Mon Sep 17 00:00:00 2001 From: David Huynh Date: Tue, 13 Apr 2010 08:06:05 +0000 Subject: [PATCH] Forgot a console.log() in history-widget.js. Updated view header to look like James' new design. git-svn-id: http://google-refine.googlecode.com/svn/trunk@467 7d457c2a-affb-35e4-300a-418c747d4874 --- .../webapp/scripts/views/data-table-view.js | 37 ++++++++++--------- .../webapp/scripts/widgets/history-widget.js | 2 +- .../webapp/styles/views/data-table-view.css | 13 +++---- 3 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/main/webapp/scripts/views/data-table-view.js b/src/main/webapp/scripts/views/data-table-view.js index 037b63fc1..cd9c2a44f 100644 --- a/src/main/webapp/scripts/views/data-table-view.js +++ b/src/main/webapp/scripts/views/data-table-view.js @@ -8,7 +8,7 @@ function DataTableView(div) { } DataTableView.prototype.resize = function() { - var topHeight = this._div.find(".viewPanel-summary").outerHeight(true) + this._div.find(".viewPanel-pagingControls").outerHeight(true); + var topHeight = this._div.find(".viewPanel-header").outerHeight(true); this._div.find(".data-table-container") .css("height", (this._div.innerHeight() - topHeight - 1) + "px") @@ -26,14 +26,19 @@ DataTableView.prototype.render = function() { var scrollLeft = (oldTableDiv.length > 0) ? oldTableDiv[0].scrollLeft : 0; var html = $( - '
' + - '
' + + '' + + '' + + '' + + '' + + '' + + '' + + '
' + '' ); var elmts = DOM.bind(html); - this._renderSummaryText(elmts.summaryDiv); - this._renderPagingControls(elmts.pagingControls[0]); + this._renderSummaryText(elmts.summary); + this._renderPagingControls(elmts.pageSizeControls, elmts.pagingControls); this._renderDataTable(elmts.table[0]); this._div.empty().append(html); @@ -57,14 +62,11 @@ DataTableView.prototype._renderSummaryText = function(elmt) { $('').html(summaryText).appendTo(elmt); }; -DataTableView.prototype._renderPagingControls = function(table) { +DataTableView.prototype._renderPagingControls = function(pageSizeControls, pagingControls) { var self = this; - var pagingControls0 = table.rows[0].cells[0]; - var pagingControls1 = table.rows[0].cells[1]; - - var firstPage = $('« first').appendTo(pagingControls0); - var previousPage = $('« previous').appendTo(pagingControls0); + var firstPage = $('« first').appendTo(pagingControls); + var previousPage = $('« previous').appendTo(pagingControls); if (theProject.rowModel.start > 0) { firstPage.addClass("action").click(function(evt) { self._onClickFirstPage(this, evt); }); previousPage.addClass("action").click(function(evt) { self._onClickPreviousPage(this, evt); }); @@ -72,9 +74,9 @@ DataTableView.prototype._renderPagingControls = function(table) { firstPage.addClass("inaction"); previousPage.addClass("inaction"); } - $('').appendTo(pagingControls0); - var nextPage = $('next page »').appendTo(pagingControls0); - var lastPage = $('last »').appendTo(pagingControls0); + $('').appendTo(pagingControls); + var nextPage = $('next page »').appendTo(pagingControls); + var lastPage = $('last »').appendTo(pagingControls); if (theProject.rowModel.start + theProject.rowModel.limit < theProject.rowModel.filtered) { nextPage.addClass("action").click(function(evt) { self._onClickNextPage(this, evt); }); lastPage.addClass("action").click(function(evt) { self._onClickLastPage(this, evt); }); @@ -83,11 +85,11 @@ DataTableView.prototype._renderPagingControls = function(table) { lastPage.addClass("inaction"); } - $('page size: ').appendTo(pagingControls1); - var sizes = [ 5, 10, 15, 20, 25, 50 ]; + $('Show ').appendTo(pageSizeControls); + var sizes = [ 10, 20, 25, 50 ]; var renderPageSize = function(index) { var pageSize = sizes[index]; - var a = $('').appendTo(pagingControls1); + var a = $('').appendTo(pageSizeControls); if (pageSize == self._pageSize) { a.text("[" + pageSize + "]").addClass("inaction"); } else { @@ -100,6 +102,7 @@ DataTableView.prototype._renderPagingControls = function(table) { for (var i = 0; i < sizes.length; i++) { renderPageSize(i); } + $(' rows').appendTo(pageSizeControls); }; DataTableView.prototype._renderDataTable = function(table) { diff --git a/src/main/webapp/scripts/widgets/history-widget.js b/src/main/webapp/scripts/widgets/history-widget.js index 3aa29310c..44b6a7141 100644 --- a/src/main/webapp/scripts/widgets/history-widget.js +++ b/src/main/webapp/scripts/widgets/history-widget.js @@ -7,7 +7,7 @@ function HistoryWidget(div, tabHeader) { HistoryWidget.prototype.resize = function() { var body = this._div.find(".history-panel-body"); var footer = this._div.find(".history-panel-footer"); - console.log(this._div.height()); + body.css("height", (this._div.height() - footer.innerHeight(true)) + "px"); }; diff --git a/src/main/webapp/styles/views/data-table-view.css b/src/main/webapp/styles/views/data-table-view.css index 0dc0b1efc..707ed9527 100644 --- a/src/main/webapp/styles/views/data-table-view.css +++ b/src/main/webapp/styles/views/data-table-view.css @@ -81,19 +81,16 @@ a.column-header-menu:hover { } -.viewPanel-summary { - margin: 1em 2em 0em 2em; -} .viewPanel-summary-row-count { font-size: 150%; font-weight: bold; } - -.viewPanel-pagingControls { - text-align: center; +table.viewPanel-header { + border-collapse: collapse; + width: 100%; } -.viewPanel-pagingControls td { - padding: 1em 2em; +table.viewPanel-header td { + padding: 1em 1em 1em 0; } div.data-table-cell-content {