Skip to:
Content

BuddyPress.org

Changeset 7458


Ignore:
Timestamp:
10/23/2013 12:40:29 AM (11 years ago)
Author:
boonebgorges
Message:

Add confirmation for Leave Group buttons in bp-legacy templates.

Fixes #5061

Props dcavins

Location:
trunk/bp-templates/bp-legacy
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-templates/bp-legacy/buddypress-functions.php

    r7442 r7458  
    241241            'remove_fav'        => __( 'Remove Favorite', 'buddypress' ),
    242242            'unsaved_changes'   => __( 'Your profile has unsaved changes. If you leave the page, the changes will be lost.', 'buddypress' ),
     243            'leave_group_confirm' => __( 'Are you sure you want to leave this group?', 'buddypress' ),
    243244        );
    244245        wp_localize_script( $asset['handle'], 'BP_DTheme', $params );
  • trunk/bp-templates/bp-legacy/js/buddypress.js

    r7443 r7458  
    10101010    /** Group Join / Leave Buttons **************************************/
    10111011
     1012    // Confirmation when clicking Leave Group in group headers
     1013    jq('#buddypress').on('click', '.group-button .leave-group', function() {
     1014        if ( false == confirm( BP_DTheme.leave_group_confirm ) ) {
     1015            return false;
     1016        }
     1017    });
     1018
    10121019    jq('#groups-dir-list').on('click', '.group-button a', function() {
    10131020        var gid = jq(this).parent().attr('id');
     
    10211028
    10221029        var thelink = jq(this);
     1030
     1031        // Leave Group confirmation within directories - must intercept
     1032        // AJAX request
     1033        if ( thelink.hasClass( 'leave-group' ) && false == confirm( BP_DTheme.leave_group_confirm ) ) {
     1034            return false;
     1035        }
    10231036
    10241037        jq.post( ajaxurl, {
Note: See TracChangeset for help on using the changeset viewer.