Make WordPress Core

Ticket #25746: 25746.2.patch

File 25746.2.patch, 1.5 KB (added by azaozz, 11 years ago)
  • src/wp-admin/js/edit-comments.js

     
    382382        },
    383383
    384384        open : function(comment_id, post_id, action) {
    385                 var t = this, editRow, rowData, act, c = $('#comment-' + comment_id), h = c.height(), replyButton;
     385                var editRow, rowData, act, replyButton, editHeight,
     386                        t = this,
     387                        c = $('#comment-' + comment_id),
     388                        h = c.height();
    386389
    387390                t.close();
    388391                t.cid = comment_id;
     
    397400                $('#comment_post_ID', editRow).val(post_id);
    398401                $('#comment_ID', editRow).val(comment_id);
    399402
    400                 if ( h > 120 )
    401                         $('#replycontent', editRow).css('height', (35+h) + 'px');
    402 
    403403                if ( action == 'edit' ) {
    404404                        $('#author', editRow).val( $('div.author', rowData).text() );
    405405                        $('#author-email', editRow).val( $('div.author-email', rowData).text() );
     
    409409                        $('#edithead, #savebtn', editRow).show();
    410410                        $('#replyhead, #replybtn, #addhead, #addbtn', editRow).hide();
    411411
     412                        if ( h > 120 ) {
     413                                // Limit the maximum height when editing very long comments to make it more manageable.
     414                                // The textarea is resizable in most browsers, so the user can adjust it if needed.
     415                                editHeight = h > 500 ? 500 : h;
     416                                $('#replycontent', editRow).css('height', editHeight + 'px');
     417                        }
     418
    412419                        c.after( editRow ).fadeOut('fast', function(){
    413420                                $('#replyrow').fadeIn(300, function(){ $(this).show(); });
    414421                        });