From 8493052a2f24c9a8213af50359632e2efd6d6945 Mon Sep 17 00:00:00 2001 From: Aris Feryanto Date: Tue, 14 Jun 2011 08:40:04 +0700 Subject: [PATCH 1/3] Fix column resizing and reordering compatibility with IE --- js/makegrid.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/makegrid.js b/js/makegrid.js index 040f35d183..b332edb446 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -45,7 +45,7 @@ width: $(obj).width() }); $(this.cPointer).css({ - top: objPos.top, + top: objPos.top }); } else { // vertical alignment $(this.cCpy).css({ @@ -55,7 +55,7 @@ width: $(obj).width() }); $(this.cPointer).css({ - top: objPos.top, + top: objPos.top }); } From 823decbaf4fbbf2feab9f2af2dc42324742226f5 Mon Sep 17 00:00:00 2001 From: Aris Feryanto Date: Tue, 14 Jun 2011 09:37:51 +0700 Subject: [PATCH 2/3] 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 ''; ?> From 84ad2a865c82dac2924c04299952d5e87bf71ae9 Mon Sep 17 00:00:00 2001 From: Aris Feryanto Date: Tue, 14 Jun 2011 09:38:34 +0700 Subject: [PATCH 3/3] Fix PMA_isBrowsing criteria --- libraries/display_tbl.lib.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/display_tbl.lib.php b/libraries/display_tbl.lib.php index acd8c711ee..b50a60d9a0 100644 --- a/libraries/display_tbl.lib.php +++ b/libraries/display_tbl.lib.php @@ -192,11 +192,11 @@ function PMA_setDisplayMode(&$the_disp_mode, &$the_total) function PMA_isBrowsing() { // global variables set from sql.php - global $is_count, $is_export, $is_func, $is_analyze; + global $is_count, $is_export, $is_func, $is_analyse; global $analyzed_sql; - - return basename($GLOBALS['PMA_PHP_SELF']) == 'sql.php' - && ! ($is_count || $is_export || $is_func || $is_analyse) + + return ! ($is_count || $is_export || $is_func || $is_analyse) + && count($analyzed_sql[0]['select_expr']) == 0 && isset($analyzed_sql[0]['queryflags']['select_from']) && count($analyzed_sql[0]['table_ref']) == 1; }