diff --git src/bp-templates/bp-nouveau/buddypress/common/js-templates/invites/index.php src/bp-templates/bp-nouveau/buddypress/common/js-templates/invites/index.php
index 79aa13acd..5f1c7521d 100644
|
|
|
65 | 65 | |
66 | 66 | <div class="action"> |
67 | 67 | <# if ( undefined === data.is_sent || ( false === data.is_sent && true === data.can_edit ) ) { #> |
68 | | <button type="button" class="button invite-button group-add-remove-invite-button bp-tooltip bp-icons" data-bp-tooltip="<?php esc_attr_e( 'Invite / Uninvite', 'buddypress' ); ?>"> |
| 68 | <button type="button" class="button invite-button group-add-remove-invite-button bp-tooltip bp-icons<# if ( data.selected ) { #> selected<# } #>" data-bp-tooltip="<# if ( data.selected ) { #><?php esc_attr_e( 'Disinvite', 'buddypress' ); ?><# } else { #><?php esc_attr_e( 'Invite', 'buddypress' ); ?><# } #>"> |
69 | 69 | <span class="icons" aria-hidden="true"></span> |
70 | | <span class="bp-screen-reader-text"><?php esc_html_e( 'Invite/Uninvite', 'buddypress' ); ?></span> |
| 70 | <span class="bp-screen-reader-text"> |
| 71 | <# if ( data.selected ) { #> |
| 72 | <?php esc_html_e( 'Disinvite', 'buddypress' ); ?> |
| 73 | <# } else { #> |
| 74 | <?php esc_html_e( 'Invite', 'buddypress' ); ?> |
| 75 | <# } #> |
| 76 | </span> |
71 | 77 | </button> |
72 | 78 | <# } #> |
73 | 79 | |
74 | 80 | <# if ( undefined !== data.can_edit && true === data.can_edit ) { #> |
75 | | <button type="button" class="button invite-button group-remove-invite-button bp-tooltip bp-icons" data-bp-tooltip="<?php esc_attr_e( 'Remove', 'buddypress' ); ?>"> |
| 81 | <button type="button" class="button invite-button group-remove-invite-button bp-tooltip bp-icons" data-bp-tooltip="<?php esc_attr_e( 'Disinvite', 'buddypress' ); ?>"> |
76 | 82 | <span class=" icons" aria-hidden="true"></span> |
77 | | <span class="bp-screen-reader-text"><?php esc_html_e( 'Remove', 'buddypress' ); ?></span> |
| 83 | <span class="bp-screen-reader-text"><?php esc_html_e( 'Disinvite', 'buddypress' ); ?></span> |
78 | 84 | </button> |
79 | 85 | <# } #> |
80 | 86 | </div> |
diff --git src/bp-templates/bp-nouveau/js/buddypress-group-invites.js src/bp-templates/bp-nouveau/js/buddypress-group-invites.js
index f78050d45..b050fbf47 100644
|
|
window.bp = window.bp || {}; |
621 | 621 | var invite = bp.Nouveau.GroupInvites.invites.get( this.model.get( 'id' ) ); |
622 | 622 | |
623 | 623 | if ( invite ) { |
624 | | this.el.className = 'selected'; |
625 | 624 | this.model.set( 'selected', true, { silent: true } ); |
626 | 625 | } |
627 | 626 | }, |
628 | 627 | |
| 628 | render: function() { |
| 629 | if ( this.model.get( 'selected' ) ) { |
| 630 | this.el.className = 'selected'; |
| 631 | } else { |
| 632 | this.el.className = ''; |
| 633 | } |
| 634 | |
| 635 | bp.Nouveau.GroupInvites.View.prototype.render.apply( this, arguments ); |
| 636 | }, |
| 637 | |
629 | 638 | toggleUser: function( event ) { |
630 | 639 | event.preventDefault(); |
631 | 640 | |
… |
… |
window.bp = window.bp || {}; |
633 | 642 | |
634 | 643 | if ( false === selected ) { |
635 | 644 | this.model.set( 'selected', true ); |
636 | | |
637 | | // Set the selected class |
638 | | $( this.el ).addClass( 'selected' ); |
639 | 645 | } else { |
640 | 646 | this.model.set( 'selected', false ); |
641 | 647 | |
642 | | // Set the selected class |
643 | | $( this.el ).removeClass( 'selected' ); |
644 | | |
645 | 648 | if ( ! bp.Nouveau.GroupInvites.invites.length ) { |
646 | 649 | bp.Nouveau.GroupInvites.invites.reset(); |
647 | 650 | } |
648 | 651 | } |
| 652 | |
| 653 | // Rerender to update buttons. |
| 654 | this.render(); |
649 | 655 | }, |
650 | 656 | |
651 | 657 | removeInvite: function( event ) { |