mirror of
https://github.com/Noratrieb/slides.git
synced 2026-01-16 09:25:06 +01:00
fix keyboard navigation in ie9 (closes #202)
This commit is contained in:
parent
aefe981040
commit
747c4c4b3d
2 changed files with 12 additions and 6 deletions
11
js/reveal.js
11
js/reveal.js
|
|
@ -1088,9 +1088,14 @@ var Reveal = (function(){
|
|||
* @param {Object} event
|
||||
*/
|
||||
function onDocumentKeyDown( event ) {
|
||||
// Disregard the event if the target is editable or a
|
||||
// modifier is present
|
||||
if ( document.querySelector( ':focus' ) !== null || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
|
||||
// Check if there's a focused element that could be using
|
||||
// the keyboard
|
||||
var activeElement = document.activeElement;
|
||||
var hasFocus = !!( document.activeElement && ( document.activeElement.type || document.activeElement.href || document.activeElement.contentEditable !== 'inherit' ) );
|
||||
|
||||
// Disregard the event if there's a focused element or a
|
||||
// keyboard modifier key is present
|
||||
if ( hasFocus || event.shiftKey || event.altKey || event.ctrlKey || event.metaKey ) return;
|
||||
|
||||
var triggered = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue