From a2093e66e2189756057f152223b64aee8b495d71 Mon Sep 17 00:00:00 2001 From: Piotr Przybylski Date: Thu, 1 Sep 2011 14:42:09 +0200 Subject: [PATCH] bugfix: makegrid broke styling of rows with conditions in table search --- js/makegrid.js | 28 ++++++++++++++++++---------- themes/original/css/theme_right.css.php | 4 +--- themes/pmahomme/css/theme_right.css.php | 26 ++++++++++++++++++++++---- 3 files changed, 41 insertions(+), 17 deletions(-) diff --git a/js/makegrid.js b/js/makegrid.js index f559677697..c1b796ad68 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -246,11 +246,21 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi reposRsz: function() { $(g.cRsz).find('div').hide(); var $firstRowCols = $(g.t).find('tr:first th.draggable:visible'); + var $resizeHandles = $(g.cRsz).find('div').removeClass('condition'); + $('.pma_table').find('thead th:first').removeClass('before-condition'); for (var n = 0; n < $firstRowCols.length; n++) { var $col = $($firstRowCols[n]); - $cb = $(g.cRsz).find('div:eq(' + n + ')'); // column border - $cb.css('left', $col.position().left + $col.outerWidth(true)) + $($resizeHandles[n]).css('left', $col.position().left + $col.outerWidth(true)) .show(); + if ($($firstRowCols[n]).hasClass('condition')) { + $($resizeHandles[n]).addClass('condition'); + if (n > 0) { + $($resizeHandles[n-1]).addClass('condition'); + } + } + } + if ($($resizeHandles[0]).hasClass('condition')) { + $('.pma_table').find('thead th:first').addClass('before-condition'); } $(g.cRsz).css('height', $(g.t).height()); }, @@ -431,9 +441,10 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi } // hide the hint if no text and the event is mouseenter - g.qtip.disable(!text && e.type == 'mouseenter'); - - g.qtip.updateContent(text, false); + if (g.qtip) { + g.qtip.disable(!text && e.type == 'mouseenter'); + g.qtip.updateContent(text, false); + } } else { g.hideHint(); } @@ -531,7 +542,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi * Reposition the column visibility drop-down arrow. */ reposDrop: function() { - $th = $(t).find('th:not(.draggable)'); + var $th = $(t).find('th:not(.draggable)'); for (var i = 0; i < $th.length; i++) { var $cd = $(g.cDrop).find('div:eq(' + i + ')'); // column drop-down arrow var pos = $($th[i]).position(); @@ -1446,7 +1457,7 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi var $firstRowCols = $(g.t).find('tr:first th.draggable'); // initialize column visibility - $col_visib = $('#col_visib'); // check if column visibility is passed from PHP + var $col_visib = $('#col_visib'); // check if column visibility is passed from PHP if ($col_visib.length > 0) { g.colVisib = $col_visib.val().split(','); for (var i = 0; i < g.colVisib.length; i++) { @@ -1459,9 +1470,6 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi } } - // get data columns in the first row of the table - var $firstRowCols = $(t).find('tr:first th.draggable'); - // make sure we have more than one column if ($firstRowCols.length > 1) { var $colVisibTh = $(g.t).find('th:not(.draggable)'); diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index 28c8d6c776..260869bf61 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -388,8 +388,6 @@ table tr.hover th { /** * marks table rows/cells if the db field is in a where condition */ -tr.condition th, -tr.condition td, td.condition, th.condition { border: 1px solid ; @@ -2295,7 +2293,7 @@ span.CodeMirror-selected { border-right: solid 1px #FFFFFF; cursor: col-resize; height: 100%; - margin-left: -6px; + margin-left: -5px; position: absolute; width: 5px; } diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index 53cde00b75..508e4f4ddb 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -553,13 +553,31 @@ table tr.hover th { /** * marks table rows/cells if the db field is in a where condition */ -tr.condition th, -tr.condition td, -td.condition, +.condition { + border-color: !important; +} + th.condition { - border: 1px solid ; + border-width: 1px 1px 0 1px; + border-style: solid; } +td.condition { + border-width: 0 1px 0 1px; + border-style: solid; +} + +tr:last-child td.condition { + border-width: 0 1px 1px 1px; +} + + +/* for first th which must have right border set (ltr only) */ +.before-condition { + border-right: 1px solid ; +} + + /** * cells with the value NULL */ -- 2.11.4.GIT