Make shift-click checkbox range selection work in both directions. props c3mdigital, SergeyBiryukov. fixes #23427.
git-svn-id: https://develop.svn.wordpress.org/trunk@25141 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
65465e9c88
commit
6ce20d366c
@ -160,7 +160,7 @@ $('.contextual-help-tabs').delegate('a', 'click focus', function(e) {
|
||||
});
|
||||
|
||||
$(document).ready( function() {
|
||||
var lastClicked = false, checks, first, last, checked, menu = $('#adminmenu'), mobileEvent,
|
||||
var lastClicked = false, checks, first, last, checked, sliced, menu = $('#adminmenu'), mobileEvent,
|
||||
pageInput = $('input.current-page'), currentPage = pageInput.val();
|
||||
|
||||
// when the menu is folded, make the fly-out submenu header clickable
|
||||
@ -286,7 +286,8 @@ $(document).ready( function() {
|
||||
last = checks.index( this );
|
||||
checked = $(this).prop('checked');
|
||||
if ( 0 < first && 0 < last && first != last ) {
|
||||
checks.slice( first, last ).prop( 'checked', function(){
|
||||
sliced = ( last > first ) ? checks.slice( first, last ) : checks.slice( last, first );
|
||||
sliced.prop( 'checked', function() {
|
||||
if ( $(this).closest('tr').is(':visible') )
|
||||
return checked;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user