Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PROD-7672 - Adding or removing User Fields using the trash icon not working #4592

Open
wants to merge 3 commits into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/bp-templates/bp-nouveau/js/buddypress-xprofile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ window.bp = window.bp || {};

// Collapse repeater sets on page load, if there are more than one sets
var repeater_set_count = $( '#profile-edit-form .repeater_group_outer' ).length;
window.deleteFieldEvent = false;

if ( repeater_set_count > 0 ) {
var repeater_set_sequence = [];
Expand Down Expand Up @@ -81,6 +82,7 @@ window.bp = window.bp || {};
// Delete button
$( '#profile-edit-form .repeater_group_outer .repeater_set_delete' ).click( function(e){
var $delete_button = $(this);
var $form = $delete_button.closest( '#profile-edit-form' );
e.preventDefault();
if ( $delete_button.hasClass( 'disabled' ) ) {
return;
Expand Down Expand Up @@ -141,6 +143,10 @@ window.bp = window.bp || {};
if ( $( '#profile-edit-form .repeater_group_outer' ).length === 1 ) {
//$( '#profile-edit-form .repeater_group_outer .repeater_set_delete' ).addClass( 'disabled' );
}

// Save the form
$form.submit();
window.deleteFieldEvent = true;
}
});

Expand Down Expand Up @@ -232,7 +238,7 @@ window.bp = window.bp || {};
} );

window.onbeforeunload = function() {
if ( shouldconfirm ) {
if ( shouldconfirm && !window.deleteFieldEvent ) {
return BP_Nouveau.unsaved_changes;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/bp-templates/bp-nouveau/js/buddypress-xprofile.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading