[buddypress-trac] [BuddyPress Trac] #7840: bp_is_messages_compose_screen not working with BP Nouveau

buddypress-trac noreply at wordpress.org
Mon May 21 10:43:56 UTC 2018


#7840: bp_is_messages_compose_screen not working with BP Nouveau
-------------------------------------------------+-------------------------
 Reporter:  sbrajesh                             |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  3.0.1
Component:  Templates                            |     Version:  3.0.0
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch needs-testing reporter-    |
  feedback                                       |
-------------------------------------------------+-------------------------

Comment (by imath):

 I think 7840.pushState.2.patch is much better to solve the trailing slash
 thing.

 If the need is to add custom message into the UI @sbrajesh This can be
 done in JavaScript using something like this :

 {{{
 function test_compose_view() {
         wp_add_inline_script( 'bp-nouveau-messages', '
 ( function( bp ) {

         if ( ! bp.Nouveau || ! bp.Nouveau.Messages ) {
                 return;
         }

         Backbone.history.on( \'all\', function( route, router, view ) {
                 if ( \'composeMessage\' !== view ) {
                         return;
                 }

                 bp.Nouveau.Messages.displayFeedback( \'Hello Compose
 View\', \'info\' );
         } );

 } )( window.bp || {} )
         ' );
 }
 add_action( 'bp_enqueue_scripts', 'test_compose_view' );
 }}}

-- 
Ticket URL: <https://buddypress.trac.wordpress.org/ticket/7840#comment:14>
BuddyPress Trac <http://buddypress.org/>
BuddyPress Trac


More information about the buddypress-trac mailing list