gl-website-deployer/admin/phpMyAdmin/js/dist/server/user_groups.js

35 lines
1.2 KiB
JavaScript
Raw Normal View History

2024-11-19 08:02:04 +01:00
/**
* @fileoverview Javascript functions used in server user groups page
* @name Server User Groups
*
* @requires jQuery
*/
/**
* Unbind all event handlers before tearing down a page
*/
AJAX.registerTeardown('server/user_groups.js', function () {
$('#deleteUserGroupModal').off('show.bs.modal');
});
/**
* Bind event handlers
*/
AJAX.registerOnload('server/user_groups.js', function () {
const deleteUserGroupModal = $('#deleteUserGroupModal');
deleteUserGroupModal.on('show.bs.modal', function (event) {
const userGroupName = $(event.relatedTarget).data('user-group');
this.querySelector('.modal-body').innerText = Functions.sprintf(Messages.strDropUserGroupWarning, Functions.escapeHtml(userGroupName));
});
deleteUserGroupModal.on('shown.bs.modal', function (event) {
const userGroupName = $(event.relatedTarget).data('user-group');
$('#deleteUserGroupConfirm').on('click', function () {
$.post('index.php?route=/server/user-groups', {
'deleteUserGroup': true,
'userGroup': userGroupName,
'ajax_request': true
}, AJAX.responseHandler);
$('#deleteUserGroupModal').modal('hide');
});
});
});