Skip to:
Content

BuddyPress.org

Changeset 12250


Ignore:
Timestamp:
10/11/2018 03:26:07 AM (14 months ago)
Author:
imath
Message:

Render the Message compose view on user's profile header button click

In BP Nouveau, we use Backbone views to display the BP Messages component screens. When the user's profile header Private Message button is clicked, we need to make sure to populate the Send To input field with the corresponding username.
This commit also fixes a regression introduced in r12115 where I forgot to update this specific button link.

Props RT77, r-a-y, DJPaul

Fixes #7908 (trunk)

Location:
trunk/src/bp-templates/bp-nouveau
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/includes/members/template-tags.php

    r12156 r12250  
    457457                        ),
    458458                        'button_attr'       => array(
    459                             'href'  => trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() ) . '#compose?r=' . bp_core_get_username( $user_id ),
     459                            'href'  => trailingslashit( bp_loggedin_user_domain() . bp_get_messages_slug() ) . 'compose?r=' . bp_core_get_username( $user_id ),
    460460                            'id'    => false,
    461461                            'class' => $button_args['link_class'],
  • trunk/src/bp-templates/bp-nouveau/js/buddypress-messages.js

    r12156 r12250  
    531531
    532532        addMentions: function() {
     533            var sendToInput = $( this.el ).find( '#send-to-input' ),
     534                mention = bp.Nouveau.getLinkParams( null, 'r' ) || null;
     535
    533536            // Add autocomplete to send_to field
    534             $( this.el ).find( '#send-to-input' ).bp_mentions( {
     537            sendToInput.bp_mentions( {
    535538                data: [],
    536539                suffix: ' '
    537540            } );
     541
     542            // Check for mention
     543            if ( ! _.isNull( mention ) ) {
     544                sendToInput.val( '@' + _.escape( mention ) + ' ' );
     545                sendToInput.focus();
     546            }
    538547        },
    539548
Note: See TracChangeset for help on using the changeset viewer.