mirror of
https://github.com/rr-/szurubooru.git
synced 2025-07-17 08:26:24 +00:00
client/users: add keyboard shortcuts to user list
This commit is contained in:
21
client/js/util/keyboard.js
Normal file
21
client/js/util/keyboard.js
Normal file
@ -0,0 +1,21 @@
|
||||
'use strict';
|
||||
|
||||
const mousetrap = require('mousetrap');
|
||||
const settings = require('../settings.js');
|
||||
|
||||
function bind(hotkey, func) {
|
||||
if (settings.getSettings().keyboardShortcuts) {
|
||||
mousetrap.bind(hotkey, func);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function unbind(hotkey) {
|
||||
mousetrap.unbind(hotkey);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
bind: bind,
|
||||
unbind: unbind,
|
||||
};
|
Reference in New Issue
Block a user