mirror of
https://github.com/WordPress/WordPress.git
synced 2025-02-20 19:56:49 +01:00
Administration: Fix undefined element JS error in pagination handler.
Follow up to [59727]. Handle cases where the `#current-page-selector` is not present on the page to prevent a JS warning. Props tobiasbg, mamaduka, jorbin, joedolson. See #62534. Built from https://develop.svn.wordpress.org/trunk@59746 git-svn-id: http://core.svn.wordpress.org/trunk@59088 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e8064c7478
commit
2b1dffc900
|
|
@ -1310,16 +1310,12 @@ $( function() {
|
|||
$document.trigger( 'wp-notice-added' );
|
||||
};
|
||||
|
||||
// Stores initial pagination value for comparison.
|
||||
var initialPagedValue = document.querySelector( '#current-page-selector' ).value;
|
||||
|
||||
$( '.bulkactions' ).parents( 'form' ).on( 'submit', function( event ) {
|
||||
var form = this,
|
||||
submitterName = event.originalEvent && event.originalEvent.submitter ? event.originalEvent.submitter.name : false;
|
||||
submitterName = event.originalEvent && event.originalEvent.submitter ? event.originalEvent.submitter.name : false,
|
||||
currentPageSelector = form.querySelector( '#current-page-selector' );
|
||||
|
||||
var currentPagedValue = form.querySelector( '#current-page-selector' ).value;
|
||||
|
||||
if ( initialPagedValue !== currentPagedValue ) {
|
||||
if ( currentPageSelector && currentPageSelector.defaultValue !== currentPageSelector.value ) {
|
||||
return; // Pagination form submission.
|
||||
}
|
||||
|
||||
|
|
|
|||
2
wp-admin/js/common.min.js
vendored
2
wp-admin/js/common.min.js
vendored
File diff suppressed because one or more lines are too long
|
|
@ -16,7 +16,7 @@
|
|||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '6.8-alpha-59742';
|
||||
$wp_version = '6.8-alpha-59746';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user