Skip to:
Content

BuddyPress.org

Changeset 6818


Ignore:
Timestamp:
02/23/2013 06:53:41 PM (12 years ago)
Author:
boonebgorges
Message:

When favoriting an activity item, only attempt to add My Favorites tab if Favorites tab is not already present

This prevents adding My Favorites in the context of a member/group activity
stream, while allowing the tab to be added on the global Activity directory
as intended.

Fixes #4849

File:
1 edited

Legend:

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

    r6791 r6818  
    209209
    210210                if ( 'fav' == type ) {
    211                     if ( !jq('.item-list-tabs #activity-favorites').length )
    212                         jq('.item-list-tabs ul #activity-mentions').before( '<li id="activity-favorites"><a href="#">' + BP_DTheme.my_favs + ' <span>0</span></a></li>');
     211                    if ( !jq('.item-list-tabs #activity-mentions-personal-li').length ) {
     212                        if ( !jq('.item-list-tabs #activity-favorites').length )
     213                            jq('.item-list-tabs ul #activity-mentions').before( '<li id="activity-favorites"><a href="#">' + BP_DTheme.my_favs + ' <span>0</span></a></li>');
     214
     215                        jq('.item-list-tabs ul #activity-favorites span').html( Number( jq('.item-list-tabs ul #activity-favorites span').html() ) + 1 );
     216                    }
    213217
    214218                    target.removeClass('fav');
    215219                    target.addClass('unfav');
    216220
    217                     jq('.item-list-tabs ul #activity-favorites span').html( Number( jq('.item-list-tabs ul #activity-favorites span').html() ) + 1 );
    218221                } else {
    219222                    target.removeClass('unfav');
Note: See TracChangeset for help on using the changeset viewer.