From 4dddaab5fe5dc0e703db907b5ee40d0e522dfd3f Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 3 Jan 2011 17:29:32 -0500 Subject: [PATCH 1/2] Fix displaying of "Show search criteria/Hide search criteria" --- js/tbl_select.js | 36 +++++++++++++++++++++--------------- 1 file changed, 21 insertions(+), 15 deletions(-) diff --git a/js/tbl_select.js b/js/tbl_select.js index 3c6cae338..48cf97bf5 100644 --- a/js/tbl_select.js +++ b/js/tbl_select.js @@ -22,23 +22,28 @@ $(document).ready(function() { cache: 'false' }); - $('') - .html(PMA_messages['strShowSearchCriteria']) + /** + * Prepare a div containing a link, otherwise it's incorrectly displayed + * after a couple of clicks + */ + $('
') .insertAfter('#tbl_search_form') // don't show it until we have results on-screen .hide(); - $('#togglesearchform').bind('click', function() { - var $link = $(this); - $('#tbl_search_form').slideToggle(); - if ($link.text() == PMA_messages['strHideSearchCriteria']) { - $link.text(PMA_messages['strShowSearchCriteria']); - } else { - $link.text(PMA_messages['strHideSearchCriteria']); - } - // avoid default click action - return false; - }) + $('#togglesearchformlink') + .html(PMA_messages['strShowSearchCriteria']) + .bind('click', function() { + var $link = $(this); + $('#tbl_search_form').slideToggle(); + if ($link.text() == PMA_messages['strHideSearchCriteria']) { + $link.text(PMA_messages['strShowSearchCriteria']); + } else { + $link.text(PMA_messages['strHideSearchCriteria']); + } + // avoid default click action + return false; + }); /** * Ajax event handler for Table Search @@ -65,10 +70,11 @@ $(document).ready(function() { $("#sqlqueryresults").html(response); $("#sqlqueryresults").trigger('appendAnchor'); $('#tbl_search_form').hide(); - $('#togglesearchform') + $('#togglesearchformlink') // always start with the Show message .text(PMA_messages['strShowSearchCriteria']) - // now it's time to show the link + $('#togglesearchformdiv') + // now it's time to show the div containing the link .show(); } else { // error message (zero rows) From 4beca2fe920abbe8a0f30a23d23b84d3d6d0c0c8 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 3 Jan 2011 17:37:33 -0500 Subject: [PATCH 2/2] Use the clip effect instead of the drop effect --- libraries/common.lib.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/common.lib.php b/libraries/common.lib.php index c0780852c..0e8a70c56 100644 --- a/libraries/common.lib.php +++ b/libraries/common.lib.php @@ -2546,9 +2546,10 @@ function PMA_generate_slider_effect($id, $message) $('') .insertBefore('#') .click(function() { - // the callback should be the 4th parameter but - // it only works as the second parameter - $('#').toggle('drop', function() { + // The callback should be the 4th parameter but + // it only works as the second parameter; + // For the possible effects see http://jqueryui.com/demos/show + $('#').toggle('clip', function() { PMA_set_status_label_(); }); });