Make WordPress Core

Changeset 34179


Ignore:
Timestamp:
09/15/2015 01:43:28 PM (9 years ago)
Author:
SergeyBiryukov
Message:

Comments: When setting the colspan value for inline edit/reply, make sure it's actually a table and the value is not empty.

Props afercia.
Fixes #33596.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/js/edit-comments.js

    r34159 r34179  
    624624            t = this,
    625625            c = $('#comment-' + comment_id),
    626             h = c.height();
     626            h = c.height(),
     627            colspanVal = 0;
    627628
    628629        t.close();
     
    634635        act = 'edit' == action ? 'edit' : 'replyto';
    635636        act = t.act = act + '-comment';
    636 
    637         $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', c ).length );
     637        colspanVal = $( 'th:visible, td:visible', c ).length;
     638
     639        // Make sure it's actually a table and there's a `colspan` value to apply.
     640        if ( editRow.hasClass( 'inline-edit-row' ) && 0 !== colspanVal ) {
     641            $( 'td', editRow ).attr( 'colspan', colspanVal );
     642        }
    638643
    639644        $('#action', editRow).val(act);
Note: See TracChangeset for help on using the changeset viewer.