From 5ab02f5a7789b6c7c15d49f6417926f7ff0d72c0 Mon Sep 17 00:00:00 2001 From: James Home Date: Thu, 14 Oct 2010 20:24:05 +0000 Subject: [PATCH] ui improvements: data-table-view header git-svn-id: http://google-refine.googlecode.com/svn/trunk@1540 7d457c2a-affb-35e4-300a-418c747d4874 --- .../views/data-table/data-table-view.js | 22 +++++------ main/webapp/modules/core/styles/common.less | 38 +++++++++--------- .../core/styles/views/data-table-view.less | 39 +++++++++++-------- 3 files changed, 52 insertions(+), 47 deletions(-) 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 a7e16dca9..bba4b4faf 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 @@ -33,13 +33,13 @@ DataTableView.prototype.render = function() { var scrollLeft = (oldTableDiv.length > 0) ? oldTableDiv[0].scrollLeft : 0; var html = $( - '
' + - '
Show as ' + - '' + + '
' + + '
Show as ' + + '' + '
' + - '
' + - '
' + - '
' + + '
' + + '
' + + '
' + '
' + '' ); @@ -54,7 +54,7 @@ DataTableView.prototype.render = function() { .appendTo(elmts.modeSelectors); if (value == ui.browsingEngine.getMode()) { - a.addClass("inaction"); + a.addClass("selected"); } else { a.addClass("action").click(function(evt) { ui.browsingEngine.setMode(value); @@ -98,7 +98,7 @@ DataTableView.prototype._renderPagingControls = function(pageSizeControls, pagin var to = Math.min(theProject.rowModel.filtered, theProject.rowModel.start + theProject.rowModel.limit); var firstPage = $('« first').appendTo(pagingControls); - var previousPage = $('« previous').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); }); @@ -107,9 +107,9 @@ DataTableView.prototype._renderPagingControls = function(pageSizeControls, pagin previousPage.addClass("inaction"); } - $('').addClass("viewPanel-pagingControls-currentPageInfo").html(" " + from + " — " + to + " ").appendTo(pagingControls); + $('').addClass("viewpanel-pagingcount").html(" " + from + " - " + to + " ").appendTo(pagingControls); - var nextPage = $('next page »').appendTo(pagingControls); + var nextPage = $('next ›').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); }); @@ -127,7 +127,7 @@ DataTableView.prototype._renderPagingControls = function(pageSizeControls, pagin .addClass("viewPanel-pagingControls-page") .appendTo(pageSizeControls); if (pageSize == self._pageSize) { - a.text(pageSize).addClass("inaction"); + a.text(pageSize).addClass("selected"); } else { a.text(pageSize).addClass("action").click(function(evt) { self._pageSize = pageSize; diff --git a/main/webapp/modules/core/styles/common.less b/main/webapp/modules/core/styles/common.less index 7d8c3d33a..7957d6dbb 100644 --- a/main/webapp/modules/core/styles/common.less +++ b/main/webapp/modules/core/styles/common.less @@ -43,6 +43,25 @@ a.secondary { color: @link_secondary; } +a.action, a.selected, a.inaction { + margin: 0 3px; + } + +a.selected { + color: #000; + font-weight: bold; + cursor: default; + } + +a.inaction { + color: #ccc; + } + +a.selected:hover, a.inaction:hover { + cursor: default; + text-decoration: none; + } + a img { border: 0; } @@ -203,25 +222,6 @@ input.inline { -a.action, -a.quiet-link { - text-decoration: none; - color: #448; -} -a.action { - margin: 0 3px; -} -a.action:hover, -a.quiet-link:hover { - color: #88f; -} - -a.inaction { - margin: 0 3px; - text-decoration: none; - color: #ccc; -} - diff --git a/main/webapp/modules/core/styles/views/data-table-view.less b/main/webapp/modules/core/styles/views/data-table-view.less index ee3e3fda8..ea6ee6a4a 100644 --- a/main/webapp/modules/core/styles/views/data-table-view.less +++ b/main/webapp/modules/core/styles/views/data-table-view.less @@ -1,27 +1,32 @@ @import-less url("../theme.less"); -#viewPanel-header { +#viewpanel-header { + position: relative; background: @chrome_secondary; font-size: 1.3em; padding: @padding_normal; -} + overflow: hidden; + text-align: right; + } -.viewPanel-pagingControls-currentPageInfo { - font-size: 150%; -} +.viewpanel-rowrecord, .viewpanel-pagesize, .viewpanel-sorting { + position: absolute; + top: @padding_normal; + background: @chrome_secondary; + padding: 0 10px 0 0; + } -a.viewPanel-pagingControls-page, a.viewPanel-browsingModes-mode { - margin: 0 2px; - padding: 2px 4px 3px 4px; - font-weight: bold; -} -a.viewPanel-pagingControls-page.inaction, a.viewPanel-browsingModes-mode.inaction { - background: #f8f8f8; - color: #777; - border: 1px solid #ff6a00; - -moz-border-radius: 4px; - -webkit-border-radius: 4px; -} +.viewpanel-pagesize { + left: 180px; + } + +.viewpanel-sorting { + left: 350px; + } + +.viewpanel-pagingcount { + font-weight: bold + } .data-table-container { border-top: 1px solid @line_accent;