mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-28 09:31:17 +01:00
feat: ctr-s for save on privileges page too
This commit is contained in:
@@ -5,7 +5,8 @@ define('admin/manage/privileges', [
|
|||||||
'translator',
|
'translator',
|
||||||
'benchpress',
|
'benchpress',
|
||||||
'categorySelector',
|
'categorySelector',
|
||||||
], function (autocomplete, translator, Benchpress, categorySelector) {
|
'mousetrap',
|
||||||
|
], function (autocomplete, translator, Benchpress, categorySelector, mousetrap) {
|
||||||
var Privileges = {};
|
var Privileges = {};
|
||||||
|
|
||||||
var cid;
|
var cid;
|
||||||
@@ -95,6 +96,11 @@ define('admin/manage/privileges', [
|
|||||||
throwConfirmModal('copyToAllGroup', Privileges.copyPrivilegesToAllCategories.bind(null, cid, groupName));
|
throwConfirmModal('copyToAllGroup', Privileges.copyPrivilegesToAllCategories.bind(null, cid, groupName));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
mousetrap.bind('ctrl+s', function (ev) {
|
||||||
|
throwConfirmModal('save', Privileges.commit);
|
||||||
|
ev.preventDefault();
|
||||||
|
});
|
||||||
|
|
||||||
function throwConfirmModal(method, onConfirm) {
|
function throwConfirmModal(method, onConfirm) {
|
||||||
bootbox.confirm('[[admin/manage/privileges:alert.confirm-' + method + ']]<br /><br />[[admin/manage/privileges:alert.no-undo]]', function (ok) {
|
bootbox.confirm('[[admin/manage/privileges:alert.confirm-' + method + ']]<br /><br />[[admin/manage/privileges:alert.no-undo]]', function (ok) {
|
||||||
if (ok) {
|
if (ok) {
|
||||||
|
|||||||
Reference in New Issue
Block a user