Ticket #31634: 31634.1.diff
File 31634.1.diff, 2.2 KB (added by , 10 years ago) |
---|
-
src/wp-admin/includes/class-wp-list-table.php
445 445 446 446 echo "</select>\n"; 447 447 448 submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two" ) );448 submit_button( __( 'Apply' ), 'action', '', false, array( 'id' => "doaction$two", 'disabled' => 'disabled' ) ); 449 449 echo "\n"; 450 450 } 451 451 -
src/wp-admin/js/inline-edit-post.js
70 70 t.revert(); 71 71 } 72 72 }); 73 },74 73 74 //Enable and Disable Apply button 75 $('select[name="action"], select[name="action2"]').change( function() { 76 t.setApply(); 77 }); 78 //Enable and Disable Apply button 79 $('table').find('.check-column :checkbox').on( 'click.wp-toggle-checkboxes', function() { 80 t.setApply(); 81 }); 82 83 }, 84 75 85 toggle : function(el){ 76 86 var t = this; 77 87 $( t.what + t.getId( el ) ).css( 'display' ) === 'none' ? t.revert() : t.edit( el ); … … 309 319 var id = $(o).closest('tr').attr('id'), 310 320 parts = id.split('-'); 311 321 return parts[parts.length - 1]; 312 } 322 }, 323 324 setApply: function() { 325 326 var bulk_action = $('select[name="action"]').val(); 327 var bulk_action2 = $('select[name="action2"]').val(); 328 329 330 var selected_rows_count = $('tbody th.check-column input[type="checkbox"]:checked').length; 331 332 //Check bulk action selector top value 333 if( '-1' !== bulk_action && selected_rows_count > 0 ) { 334 335 $('#doaction').removeAttr('disabled'); 336 337 } else { 338 $('#doaction').attr('disabled', 'disabled'); 339 } 340 341 //Check bulk action selector bottom value 342 if( '-1' !== bulk_action2 && selected_rows_count > 0 ) { 343 344 $('#doaction2').removeAttr('disabled'); 345 } else { 346 $('#doaction2').attr('disabled', 'disabled'); 347 } 348 349 } 350 313 351 }; 314 352 315 353 $( document ).ready( function(){ inlineEditPost.init(); } );