From 625d4d281f94b2f104b7b4e151f3bcd39745512c Mon Sep 17 00:00:00 2001 From: douze12 Date: Sat, 10 Oct 2015 21:42:39 +0200 Subject: [PATCH] Fix issue #21: Don't activate keyboard shortcuts when the user is in a field --- js/app.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/js/app.js b/js/app.js index 2abe652..763227b 100755 --- a/js/app.js +++ b/js/app.js @@ -64,7 +64,15 @@ Audios.prototype.initPhotoDialog = function(){ Audios.prototype.initKeyListener=function(){ $(document).keyup( function(evt) { if(this.AudioPlayer!== null && $('#activePlaylist li').length > 0){ - + + if (evt.target) { + var nodeName=evt.target.nodeName.toUpperCase(); + //don't activate shortcuts when the user is in an input, textarea or select element + if (nodeName === "INPUT" || nodeName === "TEXTAREA" || nodeName == "SELECT"){ + return; + } + } + if (evt.keyCode === 32) {//Space pause/play if($('.sm2-bar-ui').hasClass('playing')){ this.AudioPlayer.actions.stop();