From 7339b0b08dc5cd97c478981a431829bf587256f2 Mon Sep 17 00:00:00 2001 From: Maryana Rozhankivska Date: Wed, 12 Mar 2014 13:00:37 +0200 Subject: [PATCH] fix of conflict of s shortcat and entering s in input fields --- themes/baggy/js/init.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/themes/baggy/js/init.js b/themes/baggy/js/init.js index 99bffd0..4e85bea 100755 --- a/themes/baggy/js/init.js +++ b/themes/baggy/js/init.js @@ -60,16 +60,19 @@ $.fn.ready(function() { ========================================================================== */ $(window).keydown(function(e){ - switch (e.keyCode) { - // s letter - case 83: - $bagitForm.toggle(); - break; - case 27: - $bagitForm.hide(); - break; + if ( e.target.tagName.toLowerCase() !== 'input' ) { + switch (e.keyCode) { + // s letter + case 83: + $bagitForm.toggle(); + return false; + break; + case 27: + $bagitForm.hide(); + break; + } } }) -}); \ No newline at end of file +});