Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
06/21/2017 09:12:12 PM (8 years ago)
Author:
r-a-y
Message:

bp-legacy: Fix incrementing and decrementing the "Show All Comments" count in activity threads.

Previously, if a user posts a new activity comment or deletes an activity
comment, the "Show All Comments" count would not update.

This commit addresses this.

Fixes #7542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/js/buddypress.js

    r11600 r11601  
    669669
    670670                    /* Increase the "Reply (X)" button count */
    671                     jq('#activity-' + form_id[2] + ' a.acomment-reply span').html( Number( jq('#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1 );
     671                    new_count = Number( jq('#activity-' + form_id[2] + ' a.acomment-reply span').html() ) + 1;
     672                    jq('#activity-' + form_id[2] + ' a.acomment-reply span').html( new_count );
    672673
    673674                    // Increment the 'Show all x comments' string, if present
    674                     show_all_a = activity_comments.find('.show-all').find('a');
     675                    show_all_a = activity_comments.parents('.activity-comments').find('.show-all a');
    675676                    if ( show_all_a ) {
    676                         new_count = jq('li#activity-' + form_id[2] + ' a.acomment-reply span').html();
    677677                        show_all_a.html( BP_DTheme.show_x_comments.replace( '%d', new_count ) );
    678678                    }
     
    737737
    738738                    // Change the 'Show all x comments' text
    739                     show_all_a = comment_li.siblings('.show-all').find('a');
     739                    show_all_a = comment_li.parents('.activity-comments').find('.show-all a');
    740740                    if ( show_all_a ) {
    741741                        show_all_a.html( BP_DTheme.show_x_comments.replace( '%d', new_count ) );
Note: See TracChangeset for help on using the changeset viewer.