Changeset 38703
- Timestamp:
- 10/03/2016 06:36:19 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/common.js
r37714 r38703 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' ); … … 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() { … … 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' ),
Note: See TracChangeset
for help on using the changeset viewer.