Skip to:
Content

BuddyPress.org

Changeset 12170


Ignore:
Timestamp:
06/16/2018 09:02:22 AM (7 years ago)
Author:
djpaul
Message:

Templates, Nouveau: warn when navigating off-screen when there are unsent group invitiations.

Props imath

Fixes #7815

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-nouveau/js/buddypress-group-invites.js

    r12082 r12170  
    11/* global wp, bp, BP_Nouveau, _, Backbone */
    2 /* @version 3.0.0 */
     2/* @version 4.0.0 */
    33window.wp = window.wp || {};
    44window.bp = window.bp || {};
     
    361361            this.collection.on( 'add', this.outputNav, this );
    362362            this.collection.on( 'change:hide', this.showHideNavItem, this );
     363
     364            window.onbeforeunload = _.bind( this.confirmQuit, this );
    363365        },
    364366
     
    425427                }
    426428            }, this );
     429        },
     430
     431        confirmQuit: function() {
     432            if ( bp.Nouveau.GroupInvites.invites && bp.Nouveau.GroupInvites.invites.length ) {
     433                $( '[data-nav="invites"]' ).focus();
     434
     435                return false;
     436            }
    427437        }
    428438    } );
Note: See TracChangeset for help on using the changeset viewer.