Make WordPress Core

Changeset 10063


Ignore:
Timestamp:
12/05/2008 07:15:31 AM (18 years ago)
Author:
markjaquith
Message:

Fix Shift-X toggling of comments on Edit Comments

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/common.js

    r10031 r10063  
    200200                return true;
    201201        } );
    202 
    203202        $( 'thead :checkbox, tfoot :checkbox' ).click( function(e) {
    204203                var c = $(this).attr('checked');
    205 
    206                 $(this).parents( 'form:first' ).find( 'table tbody:visible, table thead:visible, table tfoot:visible').find( '.check-column :checkbox' ).attr( 'checked', function() {
    207                         if ( e.shiftKey )
     204                var toggle = e.shiftKey || toggleWithKeyboard;
     205                $(this).parents( 'form:first' ).find( 'table tbody:visible').find( '.check-column :checkbox' ).attr( 'checked', function() {
     206                        if ( toggle )
    208207                                return $(this).attr( 'checked' ) ? '' : 'checked';
    209208                        else if (c)
    210209                                return 'checked';
    211 
     210                        return '';
     211                });
     212                $(this).parents( 'form:first' ).find( 'table thead:visible, table tfoot:visible').find( '.check-column :checkbox' ).attr( 'checked', function() {
     213                        if ( toggle )
     214                                return '';
     215                        else if (c)
     216                                return 'checked';
    212217                        return '';
    213218                });
  • trunk/wp-admin/js/edit-comments.js

    r9868 r10063  
    279279        }
    280280};
    281 
     281toggleWithKeyboard = false;
    282282$(document).ready(function(){
    283283        columns.init('edit-comments');
    … …  
    300300                };
    301301                var toggle_all = function() {
     302                        toggleWithKeyboard = true;
    302303                        var master_checkbox = $('form#comments-form .check-column :checkbox:first');
    303                         master_checkbox.attr('checked', master_checkbox.attr('checked')? '' : 'checked');
    304                         checkAll('form#comments-form');
     304                        master_checkbox.click().attr('checked', '');
     305                        toggleWithKeyboard = false;
    305306                }
    306307                var make_bulk = function(value) {
  • trunk/wp-includes/script-loader.php

    r10057 r10063  
    4242        $scripts->default_version = get_bloginfo( 'version' );
    4343
    44         $scripts->add( 'common', '/wp-admin/js/common.js', array('jquery', 'hoverIntent'), '20081203' );
     44        $scripts->add( 'common', '/wp-admin/js/common.js', array('jquery', 'hoverIntent'), '20081205' );
    4545        $scripts->add( 'sack', '/wp-includes/js/tw-sack.js', false, '1.6.1' );
    4646
    … …  
    157157                        'strong' => __('Strong')
    158158                ) );
    159                 $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20081124' );
     159                $scripts->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists', 'jquery-ui-resizable', 'quicktags'), '20081205' );
    160160                $scripts->localize( 'admin-comments', 'adminCommentsL10n', array(
    161161                        'hotkeys_highlight_first' => isset($_GET['hotkeys_highlight_first']),
Note: See TracChangeset for help on using the changeset viewer.