Fixes a bug with keyboard shortcuts.

This commit is contained in:
fo 2014-10-03 15:21:48 +03:00
parent fda411b659
commit fea751bbb7
1 changed files with 2 additions and 2 deletions

View File

@ -32,7 +32,7 @@ var KeyboardShortcut = (function(my) {
}; };
window.onkeyup = function(e) { window.onkeyup = function(e) {
if(!($(":focus").is("input[type=text]") || $(":focus").is("textarea"))) { if(!($(":focus").is("input[type=text]") || $(":focus").is("input[type=password]") || $(":focus").is("textarea"))) {
var keycode = e.which; var keycode = e.which;
if (typeof shortcuts[keycode] === "object") { if (typeof shortcuts[keycode] === "object") {
shortcuts[keycode].function(); shortcuts[keycode].function();
@ -47,7 +47,7 @@ var KeyboardShortcut = (function(my) {
}; };
window.onkeydown = function(e) { window.onkeydown = function(e) {
if(!($(":focus").is("input[type=text]") || $(":focus").is("textarea"))) { if(!($(":focus").is("input[type=text]") || $(":focus").is("input[type=password]") || $(":focus").is("textarea"))) {
if(e.which === "T".charCodeAt(0)) { if(e.which === "T".charCodeAt(0)) {
if(isAudioMuted()) { if(isAudioMuted()) {
toggleAudio(); toggleAudio();