Provided the same treatment to the role and group forms
This commit is contained in:
29
assets/uf-tweaks/js/widgets/roles.js
Normal file
29
assets/uf-tweaks/js/widgets/roles.js
Normal 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();
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user