mirror of
https://github.com/WordPress/WordPress.git
synced 2024-08-26 15:53:08 +02:00
git-svn-id: http://svn.automattic.com/wordpress/trunk@7075 1a063a9b-81f0-0310-95a4-ce76da25c4cd
39 lines
1.2 KiB
JavaScript
39 lines
1.2 KiB
JavaScript
var list; var extra;
|
|
jQuery(function($) {
|
|
|
|
var dimAfter = function( r, settings ) {
|
|
$('li span.comment-count').each( function() {
|
|
var a = $(this);
|
|
var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
|
|
a.html( n.toString() );
|
|
});
|
|
// we need to do the opposite for this guy, TODO: update title
|
|
$('.post-com-count span.comment-count').each( function() {
|
|
var a = $(this);
|
|
var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? -1 : 1 );
|
|
a.html( n.toString() );
|
|
});
|
|
}
|
|
|
|
var delAfter = function( r, settings ) {
|
|
$('span.comment-count').each( function() {
|
|
var a = $(this);
|
|
if ( a.parent('.current').size() || $('#' + settings.element).is('.unapproved') && parseInt(a.html(),10) > 0 ) {
|
|
var n = parseInt(a.html(),10) - 1;
|
|
a.html( n.toString() );
|
|
}
|
|
});
|
|
|
|
if ( extra.size() == 0 || extra.children().size() == 0 ) {
|
|
return;
|
|
}
|
|
|
|
list[0].wpList.add( extra.children(':eq(0)').remove().clone() );
|
|
$('#get-extra-comments').submit();
|
|
}
|
|
|
|
extra = $('#the-extra-comment-list').wpList( { alt: '', delColor: 'none', addColor: 'none' } );
|
|
list = $('#the-comment-list').wpList( { dimAfter : dimAfter, delAfter : delAfter, addColor: 'none' } );
|
|
|
|
} );
|