Skip to content

Commit

Permalink
Make shift-click checkbox range selection work in both directions. p…
Browse files Browse the repository at this point in the history
…rops 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
  • Loading branch information
helen committed Aug 27, 2013
1 parent aa6d5dd commit 94bacd5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions wp-admin/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion wp-admin/js/common.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 94bacd5

Please sign in to comment.