From 6472e1f076265268ed8d7e5f2e60ddd879c63a7d Mon Sep 17 00:00:00 2001 From: David Huynh Date: Mon, 8 Mar 2010 06:48:12 +0000 Subject: [PATCH] Re-layout when window is resized. git-svn-id: http://google-refine.googlecode.com/svn/trunk@236 7d457c2a-affb-35e4-300a-418c747d4874 --- src/main/webapp/scripts/project.js | 4 +--- src/main/webapp/scripts/views/data-table-view.js | 12 ++++++++++++ src/main/webapp/styles/views/data-table-view.css | 2 ++ 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/main/webapp/scripts/project.js b/src/main/webapp/scripts/project.js index 395de433c..46e46fcec 100644 --- a/src/main/webapp/scripts/project.js +++ b/src/main/webapp/scripts/project.js @@ -55,11 +55,9 @@ function initializeUI(uiState) { body.append(table); var tr = table.insertRow(0); - var tdLeft = tr.insertCell(0); var tdRight = tr.insertCell(1); - tdLeft.setAttribute("width", "82%"); - tdRight.setAttribute("width", "18%"); + tdRight.setAttribute("width", "250"); ui.viewPanel = $('
').appendTo(tdLeft); ui.facetPanel = $('
').appendTo(tdRight); diff --git a/src/main/webapp/scripts/views/data-table-view.js b/src/main/webapp/scripts/views/data-table-view.js index 9f491da26..7453c7864 100644 --- a/src/main/webapp/scripts/views/data-table-view.js +++ b/src/main/webapp/scripts/views/data-table-view.js @@ -2,9 +2,21 @@ function DataTableView(div) { this._div = div; this._pageSize = 20; this._showRecon = true; + + this._initializeUI(); this._showRows(0); } +DataTableView.prototype._initializeUI = function() { + this._div.addClass("view-panel"); + + var self = this; + $(window).resize(function() { + var dataTableContainer = self._div.find(".data-table-container"); + dataTableContainer.hide().width(self._div.width() + "px").show(); + }); +}; + DataTableView.prototype.update = function(onDone) { this._showRows(0, onDone); }; diff --git a/src/main/webapp/styles/views/data-table-view.css b/src/main/webapp/styles/views/data-table-view.css index 24d5f40cb..71315cb22 100644 --- a/src/main/webapp/styles/views/data-table-view.css +++ b/src/main/webapp/styles/views/data-table-view.css @@ -1,3 +1,5 @@ +.view-panel { +} .data-table-container { border: 1px solid #ccc; overflow-x: auto;