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.

git-svn-id: https://develop.svn.wordpress.org/trunk@26550 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2013-12-03 00:54:42 +00:00
parent 75ac2cf131
commit ba4643f76e
1 changed files with 11 additions and 4 deletions

View File

@ -382,7 +382,10 @@ commentReply = {
},
open : function(comment_id, post_id, action) {
var t = this, editRow, rowData, act, c = $('#comment-' + comment_id), h = c.height(), replyButton;
var editRow, rowData, act, replyButton, editHeight,
t = this,
c = $('#comment-' + comment_id),
h = c.height();
t.close();
t.cid = comment_id;
@ -397,9 +400,6 @@ commentReply = {
$('#comment_post_ID', editRow).val(post_id);
$('#comment_ID', editRow).val(comment_id);
if ( h > 120 )
$('#replycontent', editRow).css('height', (35+h) + 'px');
if ( action == 'edit' ) {
$('#author', editRow).val( $('div.author', rowData).text() );
$('#author-email', editRow).val( $('div.author-email', rowData).text() );
@ -409,6 +409,13 @@ commentReply = {
$('#edithead, #savebtn', editRow).show();
$('#replyhead, #replybtn, #addhead, #addbtn', editRow).hide();
if ( h > 120 ) {
// Limit the maximum height when editing very long comments to make it more manageable.
// The textarea is resizable in most browsers, so the user can adjust it if needed.
editHeight = h > 500 ? 500 : h;
$('#replycontent', editRow).css('height', editHeight + 'px');
}
c.after( editRow ).fadeOut('fast', function(){
$('#replyrow').fadeIn(300, function(){ $(this).show(); });
});