Don't redirect when editing an organisation name/slug

This commit is contained in:
2022-03-08 16:54:34 +00:00
parent 05942afd61
commit 38c57d463f
2 changed files with 4 additions and 4 deletions

View File

@@ -5,7 +5,7 @@
/**
* Set up the form in a modal after being successfully attached to the body.
*/
function attachOrganisationForm() {
function attachOrganisationForm(options) {
$("body").on('renderSuccess.ufModal', function(data) {
var modal = $(this).ufModal('getModal');
var form = modal.find('.js-form');
@@ -41,7 +41,7 @@ function attachOrganisationForm() {
validator: page.validators
}).on("submitSuccess.ufForm", function(e, data) {
// Reload page on success
if (data.redirect) {
if (data.redirect && options.allow_redirect) {
window.location = data.redirect;
} else {
window.location.reload();
@@ -160,7 +160,7 @@ function bindOrganisationButtons(el, options) {
msgTarget: $("#alerts-page")
});
attachOrganisationForm();
attachOrganisationForm(options);
});
// Manage organisation merge button