Make WordPress Core

Changeset 26550


Ignore:
Timestamp:
12/03/2013 12:54:42 AM (11 years ago)
Author:
azaozz
Message:

Comments moderation screen:

  • Don't resize the textarea when replying to long comments.
  • Limit the resizing of the textarea when quick-editing long comments to 500px.

Props SergeyBiryukov, fixes #25746.

File:
1 edited

Legend:

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

    r26208 r26550  
    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();
     
    397400        $('#comment_post_ID', editRow).val(post_id);
    398401        $('#comment_ID', editRow).val(comment_id);
    399 
    400         if ( h > 120 )
    401             $('#replycontent', editRow).css('height', (35+h) + 'px');
    402402
    403403        if ( action == 'edit' ) {
     
    409409            $('#edithead, #savebtn', editRow).show();
    410410            $('#replyhead, #replybtn, #addhead, #addbtn', editRow).hide();
     411
     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            }
    411418
    412419            c.after( editRow ).fadeOut('fast', function(){
Note: See TracChangeset for help on using the changeset viewer.