Make WordPress Core

Ticket #23427: 23427.patch

File 23427.patch, 918 bytes (added by c3mdigital, 12 years ago)

Allows bulk checking in both directions

  • wp-admin/js/common.js

     
    286286                        last = checks.index( this );
    287287                        checked = $(this).prop('checked');
    288288                        if ( 0 < first && 0 < last && first != last ) {
    289                                 checks.slice( first, last ).prop( 'checked', function(){
    290                                         if ( $(this).closest('tr').is(':visible') )
    291                                                 return checked;
     289                                if ( last > first ) {
     290                                        checks.slice( first, last ).prop( 'checked', function(){
     291                                                if ( $(this).closest('tr').is(':visible') )
     292                                                        return checked;
     293                                                return false;
     294                                        });
     295                                } else {
     296                                        checks.slice(last, first).prop('checked', function () {
     297                                                if ($(this).closest('tr').is(':visible'))
     298                                                        return checked;
     299                                                return false;
     300                                        });
     301                                }
     302                        }
    292303
    293                                         return false;
    294                                 });
    295                         }
    296304                }
    297305                lastClicked = this;
    298306