Merge remote branch 'origin/master'

This commit is contained in:
Pootle server
2011-01-04 00:40:07 +01:00
2 changed files with 25 additions and 18 deletions

View File

@@ -22,23 +22,28 @@ $(document).ready(function() {
cache: 'false' cache: 'false'
}); });
$('<a id="togglesearchform"></a>') /**
.html(PMA_messages['strShowSearchCriteria']) * Prepare a div containing a link, otherwise it's incorrectly displayed
* after a couple of clicks
*/
$('<div id="togglesearchformdiv"><a id="togglesearchformlink"></a></div>')
.insertAfter('#tbl_search_form') .insertAfter('#tbl_search_form')
// don't show it until we have results on-screen // don't show it until we have results on-screen
.hide(); .hide();
$('#togglesearchform').bind('click', function() { $('#togglesearchformlink')
var $link = $(this); .html(PMA_messages['strShowSearchCriteria'])
$('#tbl_search_form').slideToggle(); .bind('click', function() {
if ($link.text() == PMA_messages['strHideSearchCriteria']) { var $link = $(this);
$link.text(PMA_messages['strShowSearchCriteria']); $('#tbl_search_form').slideToggle();
} else { if ($link.text() == PMA_messages['strHideSearchCriteria']) {
$link.text(PMA_messages['strHideSearchCriteria']); $link.text(PMA_messages['strShowSearchCriteria']);
} } else {
// avoid default click action $link.text(PMA_messages['strHideSearchCriteria']);
return false; }
}) // avoid default click action
return false;
});
/** /**
* Ajax event handler for Table Search * Ajax event handler for Table Search
@@ -65,10 +70,11 @@ $(document).ready(function() {
$("#sqlqueryresults").html(response); $("#sqlqueryresults").html(response);
$("#sqlqueryresults").trigger('appendAnchor'); $("#sqlqueryresults").trigger('appendAnchor');
$('#tbl_search_form').hide(); $('#tbl_search_form').hide();
$('#togglesearchform') $('#togglesearchformlink')
// always start with the Show message // always start with the Show message
.text(PMA_messages['strShowSearchCriteria']) .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(); .show();
} else { } else {
// error message (zero rows) // error message (zero rows)

View File

@@ -2546,9 +2546,10 @@ function PMA_generate_slider_effect($id, $message)
$('<a href="#<?php echo $id; ?>" id="anchor_<?php echo $id; ?>"><?php echo htmlspecialchars($message); ?></a>') $('<a href="#<?php echo $id; ?>" id="anchor_<?php echo $id; ?>"><?php echo htmlspecialchars($message); ?></a>')
.insertBefore('#<?php echo $id; ?>') .insertBefore('#<?php echo $id; ?>')
.click(function() { .click(function() {
// the callback should be the 4th parameter but // The callback should be the 4th parameter but
// it only works as the second parameter // it only works as the second parameter;
$('#<?php echo $id; ?>').toggle('drop', function() { // For the possible effects see http://jqueryui.com/demos/show
$('#<?php echo $id; ?>').toggle('clip', function() {
PMA_set_status_label_<?php echo $id; ?>(); PMA_set_status_label_<?php echo $id; ?>();
}); });
}); });