From 3429595b0d1d380e88610aa72efccaab9679977f Mon Sep 17 00:00:00 2001 From: David Huynh Date: Wed, 29 Sep 2010 00:16:17 +0000 Subject: [PATCH] Fixed Issue 138: Numbers should be right-justified git-svn-id: http://google-refine.googlecode.com/svn/trunk@1404 7d457c2a-affb-35e4-300a-418c747d4874 --- .../modules/core/scripts/views/data-table/cell-ui.js | 3 +++ .../webapp/modules/core/styles/views/data-table-view.css | 9 +++++++++ 2 files changed, 12 insertions(+) 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 816e2430a..cca17ddf8 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 @@ -32,6 +32,9 @@ DataTableCellUI.prototype._render = function() { $('').addClass("data-table-error").text(cell.e).appendTo(divContent); } else if (!("r" in cell) || !cell.r) { if (typeof cell.v !== "string") { + if (typeof cell.v == "number") { + divContent.addClass("data-table-cell-content-numeric"); + } $('') .addClass("data-table-value-nonstring") .text(cell.v) diff --git a/main/webapp/modules/core/styles/views/data-table-view.css b/main/webapp/modules/core/styles/views/data-table-view.css index 3237bc9e9..3eb0237d7 100644 --- a/main/webapp/modules/core/styles/views/data-table-view.css +++ b/main/webapp/modules/core/styles/views/data-table-view.css @@ -112,6 +112,10 @@ table.viewPanel-header td { div.data-table-cell-content { position: relative; } +div.data-table-cell-content-numeric { + text-align: right; +} + a.data-table-cell-edit { position: absolute; top: 0px; @@ -128,6 +132,11 @@ a.data-table-cell-edit { a.data-table-cell-edit:hover { background-position: -30px 0px; } +div.data-table-cell-content-numeric > a.data-table-cell-edit { + left: 0px; + right: auto; +} + .data-table-value-nonstring { color: #880; }