Skip to:
Content

BuddyPress.org

Changeset 4793


Ignore:
Timestamp:
07/22/2011 01:32:14 PM (14 years ago)
Author:
boonebgorges
Message:

Simplify the Messages tab unread count JS logic. Fixes #3368

File:
1 edited

Legend:

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

    r4790 r4793  
    925925                    jq('tr#m-' + jq(this).attr('value') + ' td span.unread-count').css('display', unreadCountDisplay);
    926926
    927                     var inboxcount = jq('a#user-messages span').html().substr( 1, jq('a#user-messages span').html().length );
    928                     var inboxcount = inboxcount.substr( 0, inboxcount.length - 1 );
    929 
    930                     if ( !inboxcount.length )
    931                         inboxcount = 0;
    932 
    933                     if ( parseInt(inboxcount) == inboxCount ) {
    934                         jq('a#user-messages span').css('display', unreadCountDisplay);
    935                         jq('a#user-messages span').html( unreadCount );
    936                     } else {
    937                         if ( 'read' == currentClass )
    938                             jq('a#user-messages span').html( ( parseInt(inboxcount) + 1 ) );
    939                         else
    940                             jq('a#user-messages span').html( ( parseInt(inboxcount) - thread_count ) );
    941                     }
    942 
     927                    var inboxcount = jq('tr.unread').length;
     928
     929                    jq('a#user-messages span').html( inboxcount );
     930                   
    943931                    if ( i != checkboxes.length - 1 ) {
    944932                        checkboxes_tosend += ','
Note: See TracChangeset for help on using the changeset viewer.