Skip to:
Content

BuddyPress.org

Changeset 12249


Ignore:
Timestamp:
10/11/2018 03:23:38 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 fix a regression introduced in r12115 where I forgot to update this specific button link.

Props RT77, r-a-y, DJPaul

See #7908 (Branch 3.0)

Location:
branches/3.0/src/bp-templates/bp-nouveau
Files:
2 edited

Legend:

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

    r12157 r12249  
    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'],
  • branches/3.0/src/bp-templates/bp-nouveau/js/buddypress-messages.js

    r12157 r12249  
    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.