Skip to:
Content

BuddyPress.org

Changeset 12034


Ignore:
Timestamp:
05/01/2018 09:30:06 PM (6 years ago)
Author:
imath
Message:

BP Nouveau: Activity directory, remove misleading 0 count from tabs.

Into the Activity directory the count spans added to the scope tabs are there to inform about newest activities (HeartBeat) for each scope. Starting the UI with a count set to 0 can be misleading because we could believe this count is about the total number of activities for each scope.

Fixes #7788

File:
1 edited

Legend:

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

    r12033 r12034  
    403403            // Reset the newest activities now they're displayed
    404404            this.heartbeat_data.newest = '';
    405             $( bp.Nouveau.objectNavParent + ' [data-bp-scope="all"]' ).find( 'a span' ).html( '' );
     405            $.each( $( bp.Nouveau.objectNavParent + ' [data-bp-scope]' ).find( 'a span' ), function( s, count ) {
     406                if ( 0 === parseInt( $( count ).html(), 10 ) ) {
     407                    $( count ).html( '' );
     408                }
     409            } );
    406410
    407411            // Activities are now loaded, clear the highlighted activities for the scope
Note: See TracChangeset for help on using the changeset viewer.