Skip to:
Content

BuddyPress.org

Ticket #8648: 8648.patch

File 8648.patch, 1.7 KB (added by imath, 3 years ago)
  • src/bp-templates/bp-nouveau/js/buddypress-messages.js

    diff --git src/bp-templates/bp-nouveau/js/buddypress-messages.js src/bp-templates/bp-nouveau/js/buddypress-messages.js
    index 5fdbfc5ea..ac7341e47 100644
     
    11/* global wp, BP_Nouveau, _, Backbone, tinymce, tinyMCE */
    22/* jshint devel: true */
    33/* @since 3.0.0 */
    4 /* @version 8.0.0 */
     4/* @version 10.2.0 */
    55window.wp = window.wp || {};
    66window.bp = window.bp || {};
    77
    window.bp = window.bp || {}; 
    9797                        } );
    9898                },
    9999
     100                updateNav: function( view ) {
     101                        var currentView = this.box;
     102
     103                        if ( view ) {
     104                                currentView = view;
     105                        }
     106
     107                        // Activate the appropriate nav.
     108                        $( '#subnav ul li' ).each( function( l, li ) {
     109                                $( li ).removeClass( 'current selected' );
     110                        } );
     111
     112                        $( '#subnav a#' + currentView ).closest( 'li' ).addClass( 'current selected' );
     113                },
     114
    100115                removeTinyMCE: function() {
    101116                        if ( typeof tinymce !== 'undefined' ) {
    102117                                var editor = tinymce.get( 'message_content' );
    window.bp = window.bp || {}; 
    169184                composeView: function() {
    170185                        // Remove all existing views.
    171186                        this.clearViews();
     187                        this.updateNav( 'compose' );
    172188
    173189                        // Create the loop view.
    174190                        var form = new bp.Views.messageForm( {
    window.bp = window.bp || {}; 
    181197                },
    182198
    183199                threadsView: function() {
    184                         // Activate the appropriate nav.
    185                         $( '#subnav ul li' ).each( function( l, li ) {
    186                                 $( li ).removeClass( 'current selected' );
    187                         } );
    188                         $( '#subnav a#' + this.box ).closest( 'li' ).addClass( 'current selected' );
     200                        this.updateNav();
    189201
    190202                        // Create the loop view.
    191203                        var threads_list = new bp.Views.userThreads( { collection: this.threads, box: this.box } );