Fix pagination when searching or filtering, props solarissmoke, koopersmith, fixes #17685

git-svn-id: https://develop.svn.wordpress.org/trunk@18237 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2011-06-10 19:33:45 +00:00
parent 98084cd724
commit 44ade04f5b
3 changed files with 14 additions and 3 deletions

View File

@ -228,7 +228,8 @@ screenMeta = {
};
$(document).ready( function() {
var lastClicked = false, checks, first, last, checked, dropdown;
var lastClicked = false, checks, first, last, checked, dropdown,
pageInput = $('input[name="paged"]'), currentPage;
// Move .updated and .error alert boxes. Don't move boxes designed to be inline.
$('div.wrap h2:first').nextAll('div.updated, div.error').addClass('below-h2');
@ -343,6 +344,16 @@ $(document).ready( function() {
if ( this.lastKey && 9 == this.lastKey )
this.focus();
});
if ( pageInput.length ) {
currentPage = pageInput.val();
pageInput.closest('form').submit( function(){
// Reset paging var for new filters/searches. See #17685.
if ( pageInput.val() == currentPage )
pageInput.val('1');
});
}
});
// internal use

File diff suppressed because one or more lines are too long

View File

@ -64,7 +64,7 @@ function wp_default_scripts( &$scripts ) {
$scripts->add( 'utils', "/wp-admin/js/utils$suffix.js", false, '20101110' );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20110606' );
$scripts->add( 'common', "/wp-admin/js/common$suffix.js", array('jquery', 'hoverIntent', 'utils'), '20110610' );
$scripts->add_data( 'common', 'group', 1 );
$scripts->localize( 'common', 'commonL10n', array(
'warnDelete' => __("You are about to permanently delete the selected items.\n 'Cancel' to stop, 'OK' to delete."),