Ticket #31634: 31634.diff
File 31634.diff, 2.8 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 ) { 334 335 //Check selected row is greater than 0 336 if( selected_rows_count > 0 ) { 337 338 $('#doaction').removeAttr('disabled'); 339 340 } else { 341 $('#doaction').attr('disabled', 'disabled'); 342 } 343 344 } else { 345 $('#doaction').attr('disabled', 'disabled'); 346 } 347 348 //Check bulk action selector bottom value 349 if( '-1' !== bulk_action2 ) { 350 351 //Check selected row is greater than 0 352 if( selected_rows_count > 0 ) { 353 354 $('#doaction2').removeAttr('disabled'); 355 356 } else { 357 $('#doaction2').attr('disabled', 'disabled'); 358 } 359 } else { 360 $('#doaction2').attr('disabled', 'disabled'); 361 } 362 363 //Disable both top and bottom Apply button if non is selected 364 if( '-1' === bulk_action && '-1' === bulk_action2 ) { 365 $('#doaction, #doaction2').attr('disabled', 'disabled'); 366 } 367 368 } 369 313 370 }; 314 371 315 372 $( document ).ready( function(){ inlineEditPost.init(); } );