You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Sonarr/src/UI/Hotkeys/Hotkeys.js

31 lines
926 B

10 years ago
var $ = require('jquery');
var vent = require('vent');
10 years ago
var HotkeysView = require('./HotkeysView');
module.exports = (function(){
$(document).on('keypress', function(e){
if($(e.target).is('input') || $(e.target).is('textarea')) {
return;
}
if(e.charCode === 63) {
vent.trigger(vent.Commands.OpenModalCommand, new HotkeysView());
}
});
$(document).on('keydown', function(e){
if(e.ctrlKey && e.keyCode === 83) {
vent.trigger(vent.Hotkeys.SaveSettings);
e.preventDefault();
return;
}
if($(e.target).is('input') || $(e.target).is('textarea')) {
return;
}
if(e.ctrlKey || e.metaKey || e.altKey) {
return;
}
if(e.keyCode === 84) {
vent.trigger(vent.Hotkeys.NavbarSearch);
e.preventDefault();
}
});
10 years ago
}).call(this);