|
|
|
@ -5,7 +5,8 @@ define('admin/manage/privileges', [
|
|
|
|
|
'translator',
|
|
|
|
|
'benchpress',
|
|
|
|
|
'categorySelector',
|
|
|
|
|
], function (autocomplete, translator, Benchpress, categorySelector) {
|
|
|
|
|
'mousetrap',
|
|
|
|
|
], function (autocomplete, translator, Benchpress, categorySelector, mousetrap) {
|
|
|
|
|
var Privileges = {};
|
|
|
|
|
|
|
|
|
|
var cid;
|
|
|
|
@ -95,6 +96,11 @@ define('admin/manage/privileges', [
|
|
|
|
|
throwConfirmModal('copyToAllGroup', Privileges.copyPrivilegesToAllCategories.bind(null, cid, groupName));
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
mousetrap.bind('ctrl+s', function (ev) {
|
|
|
|
|
throwConfirmModal('save', Privileges.commit);
|
|
|
|
|
ev.preventDefault();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function throwConfirmModal(method, onConfirm) {
|
|
|
|
|
bootbox.confirm('[[admin/manage/privileges:alert.confirm-' + method + ']]<br /><br />[[admin/manage/privileges:alert.no-undo]]', function (ok) {
|
|
|
|
|
if (ok) {
|
|
|
|
|