diff options
author | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-05-29 10:36:56 +0200 |
---|---|---|
committer | Hakim El Hattab <hakim.elhattab@gmail.com> | 2014-05-29 10:36:56 +0200 |
commit | 9c96a56e3330b75ca3b3205c79b2c4c1f74edd25 (patch) | |
tree | 78e70b62d78eb8aa4445af1af6eae2e392dceea5 /js | |
parent | f4ead96b1ff980db6bce104abaa202bdd1d3663c (diff) | |
download | perl-software-in-gnu-guix-9c96a56e3330b75ca3b3205c79b2c4c1f74edd25.tar perl-software-in-gnu-guix-9c96a56e3330b75ca3b3205c79b2c4c1f74edd25.tar.gz |
adjust check for focused text inputs
Diffstat (limited to 'js')
-rw-r--r-- | js/reveal.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/js/reveal.js b/js/reveal.js index 4b539b5..927670c 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -3210,11 +3210,12 @@ // Check if there's a focused element that could be using // the keyboard - var hasFocus = !!( document.activeElement && ( document.activeElement.type || document.activeElement.contentEditable !== 'inherit' ) ); + var activeElementIsCE = document.activeElement && document.activeElement.contentEditable !== 'inherit'; + var activeElementIsInput = document.activeElement && document.activeElement.tagName && /input|textarea/i.test( document.activeElement.tagName ); // Disregard the event if there's a focused element or a // keyboard modifier key is present - if( hasFocus || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return; + if( activeElementIsCE || activeElementIsInput || (event.shiftKey && event.keyCode !== 32) || event.altKey || event.ctrlKey || event.metaKey ) return; // While paused only allow "unpausing" keyboard events (b and .) if( isPaused() && [66,190,191].indexOf( event.keyCode ) === -1 ) { |