Skip to:
Content

BuddyPress.org

Changeset 5348


Ignore:
Timestamp:
11/24/2011 02:04:14 AM (14 years ago)
Author:
boonebgorges
Message:

Remove has-comments class from activity item when final activity comment is deleted, to help make spacing more uniform. Fixes #3574. Props DJPaul for help with the patch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-themes/bp-default/_inc/global.js

    r5259 r5348  
    482482
    483483                    /* Decrease the "Reply (X)" button count */
    484                     var parent_li = comment_li.parents('ul#activity-stream > li');
    485                     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 ) );
     484                    var count_span = jq('li#' + comment_li.parents('ul#activity-stream > li').attr('id') + ' a.acomment-reply span');
     485                    var new_count = count_span.html() - ( 1 + child_count );
     486                    count_span.html(new_count);
     487
     488                    /* If that was the last comment for the item, remove the has-comments class to clean up the styling */
     489                    if ( 0 == new_count ) {
     490                        jq(comment_li.parents('ul#activity-stream > li')).removeClass('has-comments');
     491                    }
    486492                }
    487493            });
Note: See TracChangeset for help on using the changeset viewer.