From 330a1aa746c46cbeca856000ffe6a786f3b37a74 Mon Sep 17 00:00:00 2001 From: Jo Michael Date: Tue, 3 Apr 2012 04:33:57 +0200 Subject: [PATCH] rfe #3488185 draggable columns vs copy column name --- ChangeLog | 1 + js/makegrid.js | 14 ++++++++++++++ themes/original/css/theme_right.css.php | 16 ++++++++++++++++ themes/pmahomme/css/theme_right.css.php | 15 +++++++++++++++ 4 files changed, 46 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8b9485682d..362ff5906e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,6 +16,7 @@ phpMyAdmin - ChangeLog - Bug #3509686 Reverting sort on joined column does not work + New transformation: append string + rfe #3507804 Session upload progress (PHP 5.4) ++ rfe #3488185 draggable columns vs copy column name 3.5.1.0 (not yet released) - bug #3510784 [edit] Limit clause ignored when sort order is remembered diff --git a/js/makegrid.js b/js/makegrid.js index 21db44f7a6..42c0236c96 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -1426,6 +1426,20 @@ function PMA_makegrid(t, enableResize, enableReorder, enableVisib, enableGridEdi }) .mouseleave(function(e) { g.showReorderHint = false; + }) + .dblclick(function(e) { + if ($(this).find("input").length) { + $(this).find("span").hide().end().find("input").show().focus().select(); + } + else { + var $input = $("") + .val($(this).find("span").text()) + .blur(function (e) { + $(this).hide().parent().find("span").show(); + }); + $(this).append($input).find("span").hide(); + $input.focus().select(); + } }); // restore column order when the restore button is clicked $('.restore_column').click(function() { diff --git a/themes/original/css/theme_right.css.php b/themes/original/css/theme_right.css.php index d04265a534..a3d789b764 100644 --- a/themes/original/css/theme_right.css.php +++ b/themes/original/css/theme_right.css.php @@ -2328,6 +2328,22 @@ span.CodeMirror-selected { position: static; } +.pma_table th.draggable { + position: relative; +} + +.pma_table th.draggable input { + font-weight: inherit; + position: absolute; + top: -.2em; + left: 0; + width: 100%; + background: transparent; + border: 0; + outline: none; + text-align: center; +} + .pma_table th.draggable span, .pma_table tbody td span { display: block; overflow: hidden; diff --git a/themes/pmahomme/css/theme_right.css.php b/themes/pmahomme/css/theme_right.css.php index b9e0199fea..e062643abb 100644 --- a/themes/pmahomme/css/theme_right.css.php +++ b/themes/pmahomme/css/theme_right.css.php @@ -2847,6 +2847,21 @@ span.CodeMirror-selected { position: static; } +.pma_table th.draggable { + position: relative; +} + +.pma_table th.draggable input { + font-weight: inherit; + position: absolute; + top: 0; + left: .2em; + width: 100%; + background: transparent; + border: 0; + outline: none; +} + .pma_table th.draggable span, .pma_table tbody td span { display: block;