From 823decbaf4fbbf2feab9f2af2dc42324742226f5 Mon Sep 17 00:00:00 2001 From: Aris Feryanto Date: Tue, 14 Jun 2011 09:37:51 +0700 Subject: [PATCH] Add 'Click to mark' hint --- js/makegrid.js | 26 ++++++++++++++++++-------- libraries/display_tbl.lib.php | 4 ++-- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/js/makegrid.js b/js/makegrid.js index b332edb446..e18225c11a 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -13,8 +13,10 @@ hintShown: false, // true if hint balloon is shown, used by updateHint() method reorderHint: '', // string, hint for column reordering sortHint: '', // string, hint for column sorting + markHint: '', // string, hint for column marking showReorderHint: false, // boolean, used by showHint() method showSortHint: false, // boolean, used by showHint() method + showMarkHint: false, hintIsHiding: false, // true when hint is still shown, but hide() already called // functions @@ -349,9 +351,13 @@ text += this.reorderHint; } if (this.showSortHint) { - text += this.showReorderHint ? '
' : ''; + text += text.length > 0 ? '
' : ''; text += this.sortHint; } + if (this.showMarkHint) { + text += text.length > 0 ? '
' : ''; + text += this.markHint; + } // hide the hint if no text if (!text) { @@ -448,6 +454,7 @@ // assign column reorder & column sort hint g.reorderHint = $('#col_order_hint').val(); g.sortHint = $('#sort_hint').val(); + g.markHint = $('#col_mark_hint').val(); // determine whether to show the column reordering hint or not g.showReorderHint = $firstRowCols.length > 1; @@ -488,22 +495,25 @@ $(t).find('th.draggable') .mousedown(function(e) { g.dragStartMove(e, this); - }) - // show/hide draggable column - .mouseenter(function(e) { - g.showHint(e); - }) - .mouseleave(function(e) { - g.hideHint(); }); } + $(t).find('th.draggable') + .mouseenter(function(e) { + g.showMarkHint = !g.showSortHint; + g.showHint(e); + }) + .mouseleave(function(e) { + g.hideHint(); + }); $(t).find('th.draggable a') .mouseenter(function(e) { g.showSortHint = true; + g.showMarkHint = false; g.showHint(e); }) .mouseleave(function(e) { g.showSortHint = false; + g.showMarkHint = true; g.showHint(e); }); $(document).mousemove(function(e) { diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index 2a15a340f8..acd8c711ee 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -406,10 +406,10 @@ function PMA_displayTableNavigation($pos_next, $pos_prev, $sql_query, $id_for_di echo ''; } - // generate text for draggable column hint + // generate hints echo ''; - // generate text for sortable column hint echo ''; + echo ''; ?>