Fix regression added in 8147dee: Switching query result pages using arrow buttons did not work

This commit is contained in:
J.M 2012-05-02 20:11:46 +02:00
parent c888fe462a
commit 41fd60e8fc

View File

@ -128,7 +128,7 @@ $(document).ready(function() {
/**
* Event handler for sqlqueryform.ajax button_submit_query
* Event handler for sqlqueryform.ajax button_submit_query
*
* @memberOf jQuery
*/
@ -136,12 +136,12 @@ $(document).ready(function() {
var $form = $(this).closest("form");
// the Go button related to query submission was clicked,
// instead of the one related to Bookmarks, so empty the
// id_bookmark selector to avoid misinterpretation in
// id_bookmark selector to avoid misinterpretation in
// import.php about what needs to be done
$form.find("select[name=id_bookmark]").attr("value","");
// let normal event propagation happen
});
/**
* Event handler for hitting enter on sqlqueryform bookmark_variable
* (the Variable textfield in Bookmarked SQL query section)
@ -154,8 +154,8 @@ $(document).ready(function() {
if (keycode == 13) { // keycode for enter key
// When you press enter in the sqlqueryform, which
// has 2 submit buttons, the default is to run the
// #button_submit_query, because of the tabindex
// attribute.
// #button_submit_query, because of the tabindex
// attribute.
// This submits #button_submit_bookmark instead,
// because when you are in the Bookmarked SQL query
// section and hit enter, you expect it to do the
@ -287,14 +287,17 @@ $(document).ready(function() {
*/
var $form = $(this).parent("form");
if (checkFormElementInRange(
$form[0],
'session_max_rows',
if (($form[0].elements['session_max_rows'] != undefined
? checkFormElementInRange(
$form[0],
'session_max_rows',
PMA_messages['strNotValidRowNumber'], 1)
: true
)
&&
checkFormElementInRange(
$form[0],
'pos',
$form[0],
'pos',
PMA_messages['strNotValidRowNumber'], 0)) {
var $msgbox = PMA_ajaxShowMessage();