Ticket #31634: 31634.2.patch
File 31634.2.patch, 3.2 KB (added by , 8 years ago) |
---|
-
src/wp-admin/js/common.js
416 416 417 417 // Init screen meta 418 418 screenMeta.init(); 419 420 /** 421 * Enable and Disable Apply button in wp-list 422 * 423 * @param {jQuery.Event} e 424 */ 425 function setApplyButton( e ) { 426 427 var listTable = $( '.wp-list-table' ).closest( 'form' ), 428 doActions = listTable.find( '#doaction, #doaction2' ); 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 >= 2 && $( '#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 keyup keydown', '#bulk-action-selector-top, #bulk-action-selector-bottom', function( event ) { 452 var listTable = $( '.wp-list-table' ).closest( 'form' ); 453 var actions = listTable.find( '#bulk-action-selector-top, #bulk-action-selector-bottom' ); 454 actions.not( this ).val( this.value ); 455 setApplyButton( event ); 456 }); 419 457 420 458 // This event needs to be delegated. Ticket #37973. 421 459 $body.on( 'click', 'tbody > tr > .check-column :checkbox', function( event ) { … … 444 482 $(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() { 445 483 return ( 0 === unchecked.length ); 446 484 }); 485 486 setApplyButton( event ); 447 487 448 488 return true; 449 489 }); … … 482 522 483 523 return false; 484 524 }); 525 526 setApplyButton( event ); 527 485 528 }); 486 529 487 530 // Show row actions on keyboard focus of its parent container element or any other elements contained within … … 980 1023 $( '.wp-initial-focus' ).focus(); 981 1024 }); 982 1025 1026 $(window).load(function(){ 1027 $('#bulk-action-selector-top').trigger('change'); 1028 }); 1029 983 1030 // Fire a custom jQuery event at the end of window resize 984 1031 ( function() { 985 1032 var timeout; -
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) {