Ticket #15480: 15480_using_index.diff

File 15480_using_index.diff, 688 bytes (added by batmoo, 2 years ago)

Improved version that uses index

  • wp-admin/js/list-table.dev.js

     
    206206 
    207207                var $link = $(this), 
    208208                        $th = $link.parent('th'), 
     209                        thIndex = $th.index(), 
    209210                        orderby = $.query.load( $link.attr('href') ).get('orderby'), 
    210211                        order; 
    211212 
     213                // th should include both headers in thead and tfoot 
     214                $th = $th.closest('table').find('thead th:eq(' + thIndex + '), tfoot th:eq(' + thIndex + ')'); 
     215 
    212216                if ( orderby == $.query.get('orderby') ) { 
    213217                        // changing the direction 
    214218                        order = ( 'asc' == $.query.get('order') ) ? 'desc' : 'asc';