diff --git src/bp-templates/bp-nouveau/js/buddypress-messages.js src/bp-templates/bp-nouveau/js/buddypress-messages.js
index 365070564..d892df8df 100644
|
|
|
window.bp = window.bp || {};
|
| 51 | 51 | |
| 52 | 52 | // Then listen to nav click and load the appropriate view. |
| 53 | 53 | $( '#subnav a' ).on( 'click', function( event ) { |
| 54 | | event.preventDefault(); |
| | 54 | var view_id = $( event.target ).prop( 'id' ), |
| | 55 | supportedView = [ 'inbox', 'starred', 'sentbox', 'compose' ]; |
| | 56 | |
| | 57 | if ( -1 === _.indexOf( supportedView, view_id ) || 'unsupported' === self.box ) { |
| | 58 | return event; |
| | 59 | } |
| 55 | 60 | |
| 56 | | var view_id = $( event.target ).prop( 'id' ); |
| | 61 | event.preventDefault(); |
| 57 | 62 | |
| 58 | 63 | // Remove the editor to be sure it will be added dynamically later. |
| 59 | 64 | self.removeTinyMCE(); |
| … |
… |
window.bp = window.bp || {};
|
| 602 | 607 | errors.push( 'send_to' ); |
| 603 | 608 | } else { |
| 604 | 609 | usernames = usernames.map( function( username ) { |
| 605 | | username = $.trim( username ); |
| | 610 | username = username.trim(); |
| 606 | 611 | return username; |
| 607 | 612 | } ); |
| 608 | 613 | |
| 609 | | if ( ! usernames || ! $.isArray( usernames ) ) { |
| | 614 | if ( ! usernames || ! _.isArray( usernames ) ) { |
| 610 | 615 | errors.push( 'send_to' ); |
| 611 | 616 | } |
| 612 | 617 | |
| … |
… |
window.bp = window.bp || {};
|
| 1382 | 1387 | |
| 1383 | 1388 | bp.Nouveau.Messages.Router = Backbone.Router.extend( { |
| 1384 | 1389 | routes: { |
| 1385 | | 'compose/' : 'composeMessage', |
| 1386 | | 'view/:id/': 'viewMessage', |
| 1387 | | 'sentbox/' : 'sentboxView', |
| 1388 | | 'starred/' : 'starredView', |
| 1389 | | 'inbox/' : 'inboxView', |
| 1390 | | '' : 'inboxView' |
| | 1390 | 'compose/' : 'composeMessage', |
| | 1391 | 'view/:id/' : 'viewMessage', |
| | 1392 | 'sentbox/' : 'sentboxView', |
| | 1393 | 'starred/' : 'starredView', |
| | 1394 | 'inbox/' : 'inboxView', |
| | 1395 | '' : 'inboxView', |
| | 1396 | '*unSupported': 'unSupported' |
| 1391 | 1397 | }, |
| 1392 | 1398 | |
| 1393 | 1399 | composeMessage: function() { |
| … |
… |
window.bp = window.bp || {};
|
| 1420 | 1426 | bp.Nouveau.Messages.threadsView(); |
| 1421 | 1427 | }, |
| 1422 | 1428 | |
| | 1429 | unSupported: function() { |
| | 1430 | bp.Nouveau.Messages.box = 'unsupported'; |
| | 1431 | }, |
| | 1432 | |
| 1423 | 1433 | inboxView: function() { |
| 1424 | 1434 | bp.Nouveau.Messages.box = 'inbox'; |
| 1425 | 1435 | bp.Nouveau.Messages.threadsView(); |