Ticket #31634: 31634.patch
File 31634.patch, 3.6 KB (added by , 8 years ago) |
---|
-
src/wp-admin/includes/class-wp-list-table.php
470 470 471 471 echo "</select>\n"; 472 472 473 submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );473 submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two", 'disabled' => 'disabled' ) ); 474 474 echo "\n"; 475 475 } 476 476 -
src/wp-admin/js/common.js
204 204 adminbar: $adminbar.height(), 205 205 menu: $adminMenuWrap.height() 206 206 }, 207 $headerEnd = $( '.wp-header-end' ); 207 $headerEnd = $( '.wp-header-end' ), 208 listTable = $( '.wp-list-table' ).closest( 'form' ), 209 doActions = listTable.find( '#doaction, #doaction2' ); 210 actions = listTable.find( '#bulk-action-selector-top, #bulk-action-selector-bottom' ); 208 211 209 212 210 213 // when the menu is folded, make the fly-out submenu header clickable … … 416 419 417 420 // Init screen meta 418 421 screenMeta.init(); 422 423 /** 424 * Enable and Disable Apply button in wp-list 425 * 426 * @param {jQuery.Event} e 427 */ 428 function setApplyButton( e ) { 429 430 if ( ( 'SELECT' === e.target.tagName && e.target.value == -1 ) ) { 431 doActions.prop( 'disabled', true ); 432 return 433 } 434 435 var checkedLength = listTable.find( 'table tbody .check-column input[type="checkbox"]:checked' ).length; 436 437 if( checkedLength && $( '#bulk-action-selector-top' ).val() != -1) { 438 doActions.prop( 'disabled', false ); 439 } else { 440 doActions.prop( 'disabled', true ); 441 } 442 443 } 444 445 // This event needs to be delegated. Ticket #31634 446 $body.on( 'click', '.cancel', function( event ) { 447 setApplyButton( event ); 448 }); 449 450 // This event needs to be delegated. Ticket #31634 451 $body.on( 'change', '#bulk-action-selector-top, #bulk-action-selector-bottom', function( event ) { 452 actions.not( this ).val( this.value ); 453 setApplyButton( event ); 454 }); 419 455 420 456 // This event needs to be delegated. Ticket #37973. 421 457 $body.on( 'click', 'tbody > tr > .check-column :checkbox', function( event ) { … … 444 480 $(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() { 445 481 return ( 0 === unchecked.length ); 446 482 }); 483 484 setApplyButton( event ); 447 485 448 486 return true; 449 487 }); … … 482 520 483 521 return false; 484 522 }); 523 524 setApplyButton( event ); 525 485 526 }); 486 527 487 528 // Show row actions on keyboard focus of its parent container element or any other elements contained within -
src/wp-admin/js/inline-edit-post.js
62 62 63 63 $('select[name="_status"] option[value="future"]', bulkRow).remove(); 64 64 65 $( '#doaction, #doaction2').click(function(e){65 $( '#doaction, #doaction2' ).click(function(e){ 66 66 var n; 67 67 68 68 t.whichBulkButtonId = $( this ).attr( 'id' ); 69 69 n = t.whichBulkButtonId.substr( 2 ); 70 70 71 71 if ( 'edit' === $( 'select[name="' + n + '"]' ).val() ) { 72 $( '#doaction, #doaction2' ).prop( 'disabled', true ); 72 73 e.preventDefault(); 73 74 t.setBulk(); 74 } else if ( $( 'form#posts-filter tr.inline-editor').length > 0 ) {75 } else if ( $( 'form#posts-filter tr.inline-editor' ).length > 0 ) { 75 76 t.revert(); 76 77 } 77 78 }); … … 316 317 } 317 318 } 318 319 319 return false;320 320 }, 321 321 322 322 getId : function(o) {