No need to show the "Hide query box" initially

This commit is contained in:
Marc Delisle
2011-02-19 11:20:11 -05:00
parent 624ec9c5f9
commit 4c7aa9cfee

View File

@@ -192,12 +192,15 @@ $(document).ready(function() {
if (! $('#sqlqueryform').find('a').is('#togglequerybox')) { if (! $('#sqlqueryform').find('a').is('#togglequerybox')) {
$('<a id="togglequerybox"></a>') $('<a id="togglequerybox"></a>')
.html(PMA_messages['strHideQueryBox']) .html(PMA_messages['strHideQueryBox'])
.appendTo("#sqlqueryform"); .appendTo("#sqlqueryform")
// initially hidden because at this point, nothing else
// appears under the link
.hide();
// Attach the toggling of the query box visibility to a click // Attach the toggling of the query box visibility to a click
$("#togglequerybox").bind('click', function() { $("#togglequerybox").bind('click', function() {
var $link = $(this) var $link = $(this)
$link.siblings().slideToggle("medium"); $link.siblings().slideToggle("fast");
if ($link.text() == PMA_messages['strHideQueryBox']) { if ($link.text() == PMA_messages['strHideQueryBox']) {
$link.text(PMA_messages['strShowQueryBox']); $link.text(PMA_messages['strShowQueryBox']);
} else { } else {
@@ -263,6 +266,7 @@ $(document).ready(function() {
$('#sqlqueryresults').show(); $('#sqlqueryresults').show();
$("#sqlqueryresults").html(data); $("#sqlqueryresults").html(data);
$("#sqlqueryresults").trigger('appendAnchor'); $("#sqlqueryresults").trigger('appendAnchor');
$('#togglequerybox').show();
if($("#togglequerybox").siblings(":visible").length > 0) { if($("#togglequerybox").siblings(":visible").length > 0) {
$("#togglequerybox").trigger('click'); $("#togglequerybox").trigger('click');
} }