Make WordPress Core

Changeset 34180


Ignore:
Timestamp:
09/15/2015 01:45:27 PM (11 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.

Merges [34179] to the 4.3 branch.

Props afercia.
See #33596.

Location:
branches/4.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.3

  • branches/4.3/src/wp-admin/js/edit-comments.js

    r34095 r34180  
    363363                        t = this,
    364364                        c = $('#comment-' + comment_id),
    365                         h = c.height();
     365                        h = c.height(),
     366                        colspanVal = 0;
    366367
    367368                t.close();
     
    373374                act = 'edit' == action ? 'edit' : 'replyto';
    374375                act = t.act = act + '-comment';
    375 
    376                 $( 'td', editRow ).attr( 'colspan', $( 'th:visible, td:visible', c ).length );
     376                colspanVal = $( 'th:visible, td:visible', c ).length;
     377
     378                // Make sure it's actually a table and there's a `colspan` value to apply.
     379                if ( editRow.hasClass( 'inline-edit-row' ) && 0 !== colspanVal ) {
     380                        $( 'td', editRow ).attr( 'colspan', colspanVal );
     381                }
    377382
    378383                $('#action', editRow).val(act);
Note: See TracChangeset for help on using the changeset viewer.