Make shift-click checkbox range selection work in both directions. props c3mdigital, SergeyBiryukov. fixes #23427.
Built from https://develop.svn.wordpress.org/trunk@25141 git-svn-id: http://core.svn.wordpress.org/trunk@25121 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
aa6d5ddb3e
commit
94bacd5887
|
@ -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;
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue