Skip to:
Content

BuddyPress.org

Changeset 4305


Ignore:
Timestamp:
04/29/2011 09:44:11 PM (14 years ago)
Author:
djpaul
Message:

Added AJAX loading spinner to activity stream 'read more' link. See #3183

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-filters.php

    r4277 r4305  
    160160function bp_activity_truncate_entry( $text ) {
    161161    global $activities_template;
    162    
     162
    163163    // The full text of the activity update should always show on the single activity screen
    164164    if ( bp_is_single_activity() )
     
    168168    $excerpt_length = apply_filters( 'bp_activity_excerpt_length', 358 );
    169169    $excerpt        = $text;
    170    
    171     $id     = !empty( $activities_template->activity->current_comment->id ) ? 'acomment-read-more-' . $activities_template->activity->current_comment->id : 'activity-read-more-' . bp_get_activity_id();
    172    
     170
     171    $id = !empty( $activities_template->activity->current_comment->id ) ? 'acomment-read-more-' . $activities_template->activity->current_comment->id : 'activity-read-more-' . bp_get_activity_id();
     172
    173173    if ( strlen( $excerpt ) > $excerpt_length )
    174         $excerpt = sprintf( '%1$s<span class="activity-read-more" id="%2$s"><a href="%3$s" rel="nofollow">%4$s</a></span>', bp_create_excerpt( $excerpt, $excerpt_length, true, '&hellip;' ), $id, bp_get_activity_thread_permalink(), $append_text );
    175    
     174        $excerpt = sprintf( '%1$s<span class="activity-read-more" id="%2$s"><a href="%3$s" rel="nofollow">%4$s</a>&nbsp;<span class="ajax-loader"></span></span>', bp_create_excerpt( $excerpt, $excerpt_length, true, '&hellip;' ), $id, bp_get_activity_thread_permalink(), $append_text );
     175
    176176    return apply_filters( 'bp_activity_truncate_entry', $excerpt, $text, $append_text );
    177177}
  • trunk/bp-themes/bp-default/_inc/global.js

    r4287 r4305  
    269269        var a_id = link_id[3];
    270270        var type = link_id[0]; /* activity or acomment */
    271        
     271
    272272        var inner_class = type == 'acomment' ? 'acomment-content' : 'activity-inner';
    273273        var a_inner = jq('li#' + type + '-' + a_id + ' .' + inner_class );
    274        
     274        target.parent().children('.ajax-loader').show();
     275
    275276        jq.post( ajaxurl, {
    276277            action: 'get_single_activity_content',
     
    278279        },
    279280        function(response) {
    280             jq(a_inner).slideUp(200,function(){
    281                 jq(a_inner).html(response);
    282                 jq(a_inner).slideDown(200);
    283             });
    284         });
    285        
    286        
     281            jq(a_inner).slideUp(300).html(response).slideDown(300);
     282        });
     283
    287284        return false;
    288285    });
Note: See TracChangeset for help on using the changeset viewer.