Make WordPress Core

Ticket #35833: inline-edit-post.diff

File inline-edit-post.diff, 2.7 KB (added by Braad, 8 years ago)

First pass at using more specific selectors

  • inline-edit-post.js

     
    88        init : function(){
    99                var t = this, qeRow = $('#inline-edit'), bulkRow = $('#bulk-edit');
    1010
    11                 t.type = $('table.widefat').hasClass('pages') ? 'page' : 'post';
     11                t.type = $('table.wp-list-table.widefat').hasClass('pages') ? 'page' : 'post';
    1212                t.what = '#post-';
    1313
    1414                // prepare the edit rows
     
    8686                var te = '', type = this.type, tax, c = true;
    8787                this.revert();
    8888
    89                 $( '#bulk-edit td' ).attr( 'colspan', $( 'th:visible, td:visible', '.widefat:first thead' ).length );
     89                $( '#bulk-edit td' ).attr( 'colspan', $( 'th:visible, td:visible', 'table.wp-list-table.widefat:first thead' ).length );
    9090                // Insert the editor at the top of the table with an empty row above to maintain zebra striping.
    91                 $('table.widefat tbody').prepend( $('#bulk-edit') ).prepend('<tr class="hidden"></tr>');
     91                $('table..wp-list-table.widefat tbody').prepend( $('#bulk-edit') ).prepend('<tr class="hidden"></tr>');
    9292                $('#bulk-edit').addClass('inline-editor').show();
    9393
    9494                $( 'tbody th.check-column input[type="checkbox"]' ).each( function() {
     
    108108                $('#bulk-titles a').click(function(){
    109109                        var id = $(this).attr('id').substr(1);
    110110
    111                         $('table.widefat input[value="' + id + '"]').prop('checked', false);
     111                        $('table.wp-list-table.widefat input[value="' + id + '"]').prop('checked', false);
    112112                        $('#ttle'+id).remove();
    113113                });
    114114
     
    136136
    137137                // add the new edit row with an extra blank row underneath to maintain zebra striping.
    138138                editRow = $('#inline-edit').clone(true);
    139                 $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', '.widefat:first thead' ).length );
     139                $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', 'table.wp-list-table.widefat:first thead' ).length );
    140140
    141141                $(t.what+id).removeClass('is-expanded').hide().after(editRow).after('<tr class="hidden"></tr>');
    142142
     
    248248                        id = this.getId(id);
    249249                }
    250250
    251                 $( 'table.widefat .spinner' ).addClass( 'is-active' );
     251                $( 'table.wp-list-table.widefat .spinner' ).addClass( 'is-active' );
    252252
    253253                params = {
    254254                        action: 'inline-save',
     
    266266                        function(r) {
    267267                                var $errorSpan = $( '#edit-' + id + ' .inline-edit-save .error' );
    268268
    269                                 $( 'table.widefat .spinner' ).removeClass( 'is-active' );
     269                                $( 'table.wp-list-table.widefat .spinner' ).removeClass( 'is-active' );
    270270                                $( '.ac_results' ).hide();
    271271
    272272                                if (r) {
     
    295295
    296296        // Revert is for both Quick Edit and Bulk Edit.
    297297        revert : function(){
    298                 var $tableWideFat = $( '.widefat' ),
     298                var $tableWideFat = $( 'table.wp-list-table.widefat' ),
    299299                        id = $( '.inline-editor', $tableWideFat ).attr( 'id' );
    300300
    301301                if ( id ) {