Skip to:
Content

BuddyPress.org

Changeset 12447


Ignore:
Timestamp:
08/16/2019 01:50:51 PM (6 years ago)
Author:
dcavins
Message:

Nouveau: Change AJAX template loading event emission timing.

In Nouveau, a useful event, bp_ajax_request, is emitted when a template
is updated wth new content. However, the new content is eased in using
a fadeIn transition. This changeset moves the event to the fadeIn complete
so that any actions tied to bp_ajax_request will be operating on
visible and full-size elements.

Fixes #8128.

File:
1 edited

Legend:

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

    r12322 r12447  
    319319                            $( data.target ).fadeOut( 100, function() {
    320320                                self.inject( this, response.data.contents, data.method );
    321                                 $( this ).fadeIn( 100 );
    322 
     321                                $( this ).fadeIn( 100, 'swing', function(){
     322                                    // Inform other scripts the list of objects has been refreshed.
     323                                    $( data.target ).trigger( 'bp_ajax_request', $.extend( data, { response: response.data } ) );
     324                                } );
     325                            } );
     326                        } );
     327
     328                    } else {
     329                        $( data.target ).fadeOut( 100, function() {
     330                            self.inject( this, response.data.contents, data.method );
     331                            $( this ).fadeIn( 100, 'swing', function(){
    323332                                // Inform other scripts the list of objects has been refreshed.
    324333                                $( data.target ).trigger( 'bp_ajax_request', $.extend( data, { response: response.data } ) );
    325334                            } );
    326                         } );
    327 
    328                     } else {
    329                         $( data.target ).fadeOut( 100, function() {
    330                             self.inject( this, response.data.contents, data.method );
    331                             $( this ).fadeIn( 100 );
    332 
    333                             // Inform other scripts the list of objects has been refreshed.
    334                             $( data.target ).trigger( 'bp_ajax_request', $.extend( data, { response: response.data } ) );
    335335                        } );
    336336                    }
Note: See TracChangeset for help on using the changeset viewer.