Skip to:
Content

BuddyPress.org

Changeset 8264


Ignore:
Timestamp:
04/10/2014 10:24:39 PM (11 years ago)
Author:
imath
Message:

When posting the very first activity update, avoid checking for previous activities

Since r8251, Activity HeartBeat feature needs to "parse" the different classes of the first activity item displayed in the stream. But before doing so, we actually need to check there is at least one activity displayed.

props pross

Fixes #5528

File:
1 edited

Legend:

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

    r8251 r8264  
    113113        var firstrow = jq( '#buddypress ul.activity-list li' ).first();
    114114        var activity_row = firstrow;
    115 
    116         if ( activity_row.hasClass( 'load-newest' ) ) {
    117             activity_row = firstrow.next();
    118         }
    119 
    120         timestamp = activity_row.prop( 'class' ).match( /date-recorded-([0-9]+)/ );
     115        var timestamp = null;
     116
     117        // Checks if at least one activity exists
     118        if ( firstrow.length ) {
     119
     120            if ( activity_row.hasClass( 'load-newest' ) ) {
     121                activity_row = firstrow.next();
     122            }
     123           
     124            timestamp = activity_row.prop( 'class' ).match( /date-recorded-([0-9]+)/ );
     125        }
    121126       
    122127        if ( timestamp ) {
Note: See TracChangeset for help on using the changeset viewer.