Don't redirect when editing an organisation name/slug
This commit is contained in:
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
// Control buttons
|
// 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
|
// Table of users in this organisation
|
||||||
$("#widget-organisation-members").ufTable({
|
$("#widget-organisation-members").ufTable({
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
/**
|
/**
|
||||||
* Set up the form in a modal after being successfully attached to the body.
|
* 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) {
|
$("body").on('renderSuccess.ufModal', function(data) {
|
||||||
var modal = $(this).ufModal('getModal');
|
var modal = $(this).ufModal('getModal');
|
||||||
var form = modal.find('.js-form');
|
var form = modal.find('.js-form');
|
||||||
@@ -41,7 +41,7 @@ function attachOrganisationForm() {
|
|||||||
validator: page.validators
|
validator: page.validators
|
||||||
}).on("submitSuccess.ufForm", function(e, data) {
|
}).on("submitSuccess.ufForm", function(e, data) {
|
||||||
// Reload page on success
|
// Reload page on success
|
||||||
if (data.redirect) {
|
if (data.redirect && options.allow_redirect) {
|
||||||
window.location = data.redirect;
|
window.location = data.redirect;
|
||||||
} else {
|
} else {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
@@ -160,7 +160,7 @@ function bindOrganisationButtons(el, options) {
|
|||||||
msgTarget: $("#alerts-page")
|
msgTarget: $("#alerts-page")
|
||||||
});
|
});
|
||||||
|
|
||||||
attachOrganisationForm();
|
attachOrganisationForm(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Manage organisation merge button
|
// Manage organisation merge button
|
||||||
|
|||||||
Reference in New Issue
Block a user