Skip to:
Content

BuddyPress.org

Changeset 11911


Ignore:
Timestamp:
03/27/2018 10:40:45 PM (8 years ago)
Author:
r-a-y
Message:

bp-legacy: Disable "Send Reply" button onclick when replying to a private message thread via AJAX.

Previously, it was possible for a user to click on the "Send Reply" button
multiple times, causing the same reply to be duplicated several times over.

This commit addreses this by disabling the "Send Reply" button when it is
clicked and re-enables it after the AJAX request is completed.

Props jdgrimes.

Fixes #7718.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/bp-templates/bp-legacy/js/buddypress.js

    r11887 r11911  
    14211421                button  = jq('#send_reply_button');
    14221422
    1423             jq(button).addClass('loading');
     1423            jq(button).addClass('loading').prop( 'disabled', true );
    14241424
    14251425            jq.post( ajaxurl, {
     
    14521452                    });
    14531453                }
    1454                 jq(button).removeClass('loading');
     1454                jq(button).removeClass('loading').prop( 'disabled', false );
    14551455            });
    14561456
Note: See TracChangeset for help on using the changeset viewer.