Don't redirect when editing an organisation name/slug
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
$(document).ready(function() {
|
||||
// Control buttons
|
||||
bindOrganisationButtons($("#view-organisation"), { delete_redirect: page.delete_redirect, leave_redirect: page.leave_redirect });
|
||||
bindOrganisationButtons($("#view-organisation"), { delete_redirect: page.delete_redirect, leave_redirect: page.leave_redirect, allow_redirect: true });
|
||||
|
||||
// Table of users in this organisation
|
||||
$("#widget-organisation-members").ufTable({
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user