Skip to:
Content

BuddyPress.org

Ticket #3574: 3574.01.patch

File 3574.01.patch, 1016 bytes (added by boonebgorges, 14 years ago)
  • bp-themes/bp-default/_inc/global.js

    diff --git bp-themes/bp-default/_inc/global.js bp-themes/bp-default/_inc/global.js
    index c62d161..ded0663 100644
    jq(document).ready( function() { 
    449449
    450450                                        /* Decrease the "Reply (X)" button count */
    451451                                        var parent_li = comment_li.parents('ul#activity-stream > li');
    452                                         jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').html( jq('li#' + parent_li.attr('id') + ' a.acomment-reply span').html() - ( 1 + child_count ) );
     452                                        var count_span = jq('li#' + parent_li.attr('id') + ' a.acomment-reply span');
     453                                        var current_count = jq(count_span).html();
     454
     455                                        var new_count = current_count - ( 1 + child_count );
     456                                        jq(count_span).html(new_count);
     457
     458                                        /* If that was the last comment for the item, remove the has-comments class to clean up the styling */
     459                                        if ( 0 == new_count ) {
     460                                                jq(comment_li.parents('ul#activity-stream > li')).removeClass('has-comments');
     461                                        }
    453462                                }
    454463                        });
    455464