When there are many columns in a table, we risk not seeing the search results; so hide the search criteria, with a possibility of showing them.
This commit is contained in:
@@ -85,6 +85,10 @@ $js_messages['strHideQueryBox'] = __('Hide query box');
|
|||||||
$js_messages['strShowQueryBox'] = __('Show query box');
|
$js_messages['strShowQueryBox'] = __('Show query box');
|
||||||
$js_messages['strInlineEdit'] = __('Inline Edit');
|
$js_messages['strInlineEdit'] = __('Inline Edit');
|
||||||
|
|
||||||
|
/* For tbl_select.js */
|
||||||
|
$js_messages['strHideSearchCriteria'] = __('Hide search criteria');
|
||||||
|
$js_messages['strShowSearchCriteria'] = __('Show search criteria');
|
||||||
|
|
||||||
/* For tbl_change.js */
|
/* For tbl_change.js */
|
||||||
$js_messages['strIgnore'] = __('Ignore');
|
$js_messages['strIgnore'] = __('Ignore');
|
||||||
|
|
||||||
|
@@ -22,6 +22,24 @@ $(document).ready(function() {
|
|||||||
cache: 'false'
|
cache: 'false'
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('<a id="togglesearchform"></a>')
|
||||||
|
.html(PMA_messages['strShowSearchCriteria'])
|
||||||
|
.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;
|
||||||
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ajax event handler for Table Search
|
* Ajax event handler for Table Search
|
||||||
*
|
*
|
||||||
@@ -45,6 +63,12 @@ $(document).ready(function() {
|
|||||||
if (typeof response == 'string') {
|
if (typeof response == 'string') {
|
||||||
// found results
|
// found results
|
||||||
$("#searchresults").html(response);
|
$("#searchresults").html(response);
|
||||||
|
$('#tbl_search_form').hide();
|
||||||
|
$('#togglesearchform')
|
||||||
|
// always start with the Show message
|
||||||
|
.text(PMA_messages['strShowSearchCriteria'])
|
||||||
|
// now it's time to show the link
|
||||||
|
.show();
|
||||||
} else {
|
} else {
|
||||||
// error message (zero rows)
|
// error message (zero rows)
|
||||||
$("#searchresults").html(response['message']);
|
$("#searchresults").html(response['message']);
|
||||||
|
Reference in New Issue
Block a user