Ticket #25060: 25060.4.patch
File 25060.4.patch, 3.0 KB (added by , 8 years ago) |
---|
-
wp-admin/js/edit-comments.js
464 464 post.comments_listing = this.comments_listing; 465 465 post.p = $('[name="p"]').val(); 466 466 467 if ( $('#comment-' + $('#comment_ID').val()).hasClass('unapproved') ) 467 var commentID = $('#comment_ID').val(); 468 var edit_row = $('#comment-' + commentID); 469 var remove_class; 470 if (edit_row.hasClass('unapproved')) 468 471 post.approve_parent = 1; 469 472 473 if (edit_row.prev().hasClass('even')) 474 remove_class = true; 475 470 476 $.ajax({ 471 477 type : 'POST', 472 478 url : ajaxurl, 473 479 data : post, 474 success : function(x) { commentReply.show(x); }, 480 success : function(x) { 481 commentReply.show(x); 482 if (remove_class) 483 $('#comment-' + commentID).removeClass('even thread-even').addClass('alt odd thread-odd') 484 }, 475 485 error : function(r) { commentReply.error(r); } 476 486 }); 477 487 … … 479 489 }, 480 490 481 491 show : function(xml) { 482 var t = this, r, c, id, bg , pid;492 var t = this, r, c, id, bgClass, pid; 483 493 484 494 if ( typeof(xml) == 'string' ) { 485 495 t.error({'responseText': xml}); … … 506 516 updatePending( -1 ); 507 517 508 518 if ( this.comments_listing == 'moderated' ) { 509 pid.a nimate( { 'backgroundColor':'#CCEEBB' }, 400, function(){510 pid. fadeOut();511 } );519 pid.addClass('status-transition' , 400, setTimeout(function () { 520 pid.removeClass('status-transition'); 521 }, 400) ); 512 522 return; 513 523 } 514 524 } 515 525 516 $(c).hide() 526 $(c).hide(); 517 527 $('#replyrow').after(c); 518 528 id = $(id); 519 529 t.addEvents(id); 520 bg = id.hasClass('unapproved') ? '#FFFFE0' : id.closest('.widefat, .postbox').css('backgroundColor');530 bgClass = id.hasClass('unapproved') ? 'unapproved' : 'approved'; 521 531 522 id.animate( { 'backgroundColor':'#CCEEBB' }, 300 ) 523 .animate( { 'backgroundColor': bg }, 300, function() { 524 if ( pid && pid.length ) { 525 pid.animate( { 'backgroundColor':'#CCEEBB' }, 300 ) 526 .animate( { 'backgroundColor': bg }, 300 ) 527 .removeClass('unapproved').addClass('approved') 528 .find('div.comment_status').html('1'); 529 } 530 }); 531 532 id.removeClass(bgClass); 533 id.addClass('status-transition', 300, setTimeout( function () { 534 id.removeClass('status-transition'); 535 id.addClass(bgClass); 536 }, 300), function () { 537 if (pid && pid.length) { 538 pid.removeClass('unapproved'); 539 pid.addClass('status-transition', 300, setTimeout(function () { 540 pid.removeClass('status-transition'); 541 }, 300), 542 pid.removeClass('unapproved').addClass('approved') 543 .find('div.comment_status').html('1')); 544 } 545 }); 532 546 }, 533 547 534 548 error : function(r) { -
wp-admin/css/wp-admin.css
1098 1098 display: inline; 1099 1099 } 1100 1100 1101 .status-transition { 1102 background-color: #cceebb; 1103 } 1104 1101 1105 td.action-links, 1102 1106 th.action-links { 1103 1107 text-align: right;