Provided the same treatment to the role and group forms

This commit is contained in:
2023-06-01 15:00:01 +01:00
parent bf9467b480
commit d5a823692b
19 changed files with 324 additions and 1 deletions

View File

@@ -0,0 +1,29 @@
/**
* Roles widget. Sets up dropdowns, modals, etc for a table of roles.
*
* This script depends on slug-override.js
*
*/
/**
* Override the admin "attachRoleForm" method for the sake of an element id override
*/
function attachRoleForm() {
$("body").on('renderSuccess.ufModal', function (data) {
var modal = $(this).ufModal('getModal');
var form = modal.find('.js-form');
/**
* Set up modal widgets
*/
slugOverride(form, '#input-role-slug-override');
// Set up the form for submission
form.ufForm({
validator: page.validators
}).on("submitSuccess.ufForm", function() {
// Reload page on success
window.location.reload();
});
});
}