Skip to:
Content

BuddyPress.org

Changeset 11859


Ignore:
Timestamp:
02/17/2018 12:15:20 PM (7 years ago)
Author:
hnla
Message:

Nouveau: Correct non showing of single comment reply in activity stream

in the activity JS we count replies and if less than one we attempt to ensure that we do show a comment where initially all are hidden, this was actioned by comparing counts and removing the 'hide' actions/classes for the last-child element, this fails if the first or only element.

Commit addresses this by removing the .last() function.

Todo: This comments section of scripting has proven problematic & this may not be a final solution, more testing would be useful in general for commenst display.

File:
1 edited

Legend:

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

    r11686 r11859  
    356356                } );
    357357
    358                 // If all parents are hidden, reveal at least the last on. It seems very risky to manipulate the DOM to keep exactly 5 comments!
     358                // If all parents are hidden, reveal at least one. It seems very risky to manipulate the DOM to keep exactly 5 comments!
    359359                if ( $( comment_parents ).children( '.bp-hidden' ).length === $( comment_parents ).children( 'li' ).length - 1 && $( comment_parents ).find( 'li.show-all' ) ) {
    360                     $( comment_parents ).children( 'li' ).last().removeClass( 'bp-hidden' ).toggle();
     360                    $( comment_parents ).children( 'li' ).removeClass( 'bp-hidden' ).toggle();
    361361                }
    362362            } );
Note: See TracChangeset for help on using the changeset viewer.