Ticket #37973: 37973.2.diff
File 37973.2.diff, 1.7 KB (added by , 8 years ago) |
---|
-
src/wp-admin/js/common.js
426 426 // Init screen meta 427 427 screenMeta.init(); 428 428 429 // check all checkboxes 430 $('tbody').children().children('.check-column').find(':checkbox').click( function(e) { 431 if ( 'undefined' == e.shiftKey ) { return true; } 432 if ( e.shiftKey ) { 429 // This event needs to be delegated. Ticket #37973. 430 $body.on( 'click', 'tbody .check-column :checkbox', function( even ) { 431 // Shift click to select a range of checkboxes. 432 if ( 'undefined' == event.shiftKey ) { return true; } 433 if ( event.shiftKey ) { 433 434 if ( !lastClicked ) { return true; } 434 435 checks = $( lastClicked ).closest( 'form' ).find( ':checkbox' ).filter( ':visible:enabled' ); 435 436 first = checks.index( lastClicked ); … … 447 448 } 448 449 lastClicked = this; 449 450 450 // toggle "check all" checkboxes451 // Toggle the "Select all" checkboxes depending if the other ones are all checked or not. 451 452 var unchecked = $(this).closest('tbody').find(':checkbox').filter(':visible:enabled').not(':checked'); 452 453 $(this).closest('table').children('thead, tfoot').find(':checkbox').prop('checked', function() { 453 454 return ( 0 === unchecked.length ); … … 456 457 return true; 457 458 }); 458 459 459 $('thead, tfoot').find('.check-column :checkbox').on( 'click.wp-toggle-checkboxes', function( event ) { 460 // This event needs to be delegated. Ticket #37973. 461 $body.on( 'click.wp-toggle-checkboxes', 'thead .check-column :checkbox, tfoot .check-column :checkbox', function( event ) { 460 462 var $this = $(this), 461 463 $table = $this.closest( 'table' ), 462 464 controlChecked = $this.prop('checked'),