Fade approved comments from moderated list. Props filosofo. fixes #6032

git-svn-id: https://develop.svn.wordpress.org/trunk@7093 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2008-02-28 21:51:57 +00:00
parent b2e8a6ac54
commit 9f57568f8f
1 changed files with 8 additions and 1 deletions

View File

@ -216,6 +216,7 @@ var wpList = {
ajaxDim: function( e, s ) { ajaxDim: function( e, s ) {
var list = this; e = $(e); s = s || {}; var list = this; e = $(e); s = s || {};
var cls = wpList.parseClass(e,'dim'); var cls = wpList.parseClass(e,'dim');
var hide = ( 'moderated' == $('input[name="comment_status"]').val() ) ? true : false;
s = wpList.pre.call( list, e, s, 'dim' ); s = wpList.pre.call( list, e, s, 'dim' );
s.element = cls[2] || s.element || null; s.element = cls[2] || s.element || null;
@ -247,8 +248,14 @@ var wpList = {
element.toggleClass( s.dimClass ) element.toggleClass( s.dimClass )
var dimColor = isClass ? s.dimAddColor : s.dimDelColor; var dimColor = isClass ? s.dimAddColor : s.dimDelColor;
if ( 'none' != dimColor ) { if ( 'none' != dimColor ) {
if ( hide ) {
var anim = 'slideUp';
if ( element.css( 'display' ).match(/table/) )
anim = 'fadeOut'; // Can't slideup table rows and other table elements. Known jQuery bug
element.animate( { backgroundColor: dimColor }, 'fast' )[anim]( 'fast' )
} else
element.animate( { backgroundColor: dimColor }, 'fast' )
element element
.animate( { backgroundColor: dimColor }, 'fast' )
.queue( function() { element.toggleClass(s.dimClass); $(this).dequeue(); } ) .queue( function() { element.toggleClass(s.dimClass); $(this).dequeue(); } )
.animate( { backgroundColor: color }, { complete: function() { $(this).css( 'backgroundColor', '' ); } } ); .animate( { backgroundColor: color }, { complete: function() { $(this).css( 'backgroundColor', '' ); } } );
} }