diff options
author | olivierbloch | 2013-10-01 14:06:55 -0700 |
---|---|---|
committer | olivierbloch | 2013-10-01 14:06:55 -0700 |
commit | e608dafaf112f1adb2b131f9e390ff19920d791b (patch) | |
tree | c7da74c50d44572b33eeff006d0a7312c1c27fdb /js/reveal.js | |
parent | 059311923bacc80e03393ac7d7aa2be7b8ac6fc4 (diff) | |
parent | 27a86d261e9d4c1f2e29b70e6de119b745aed2ec (diff) |
IE11 Support
Added unprefixed touch-action CSS attribute
Added unprefixed pointer events handlers hooks
Diffstat (limited to 'js/reveal.js')
-rw-r--r-- | js/reveal.js | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/js/reveal.js b/js/reveal.js index d3d6b23..4e9873b 100644 --- a/js/reveal.js +++ b/js/reveal.js @@ -595,11 +595,18 @@ var Reveal = (function(){ dom.wrapper.addEventListener( 'touchend', onTouchEnd, false ); // Support pointer-style touch interaction as well + // IE 10 uses prefixed version of pointer events if( window.navigator.msPointerEnabled ) { dom.wrapper.addEventListener( 'MSPointerDown', onPointerDown, false ); dom.wrapper.addEventListener( 'MSPointerMove', onPointerMove, false ); dom.wrapper.addEventListener( 'MSPointerUp', onPointerUp, false ); } + // IE 11 uses un-prefixed version of pointer events + if( window.navigator.pointerEnabled ) { + dom.wrapper.addEventListener( 'pointerdown', onPointerDown, false ); + dom.wrapper.addEventListener( 'pointermove', onPointerMove, false ); + dom.wrapper.addEventListener( 'pointerup', onPointerUp, false ); + } } if( config.keyboard ) { @@ -636,11 +643,18 @@ var Reveal = (function(){ dom.wrapper.removeEventListener( 'touchmove', onTouchMove, false ); dom.wrapper.removeEventListener( 'touchend', onTouchEnd, false ); + // IE10 if( window.navigator.msPointerEnabled ) { dom.wrapper.removeEventListener( 'MSPointerDown', onPointerDown, false ); dom.wrapper.removeEventListener( 'MSPointerMove', onPointerMove, false ); dom.wrapper.removeEventListener( 'MSPointerUp', onPointerUp, false ); } + // IE11 + if( window.navigator.pointerEnabled ) { + dom.wrapper.removeEventListener( 'pointerdown', onPointerDown, false ); + dom.wrapper.removeEventListener( 'pointermove', onPointerMove, false ); + dom.wrapper.removeEventListener( 'pointerup', onPointerUp, false ); + } if ( config.progress && dom.progress ) { dom.progress.removeEventListener( 'click', onProgressClicked, false ); @@ -2557,7 +2571,7 @@ var Reveal = (function(){ */ function onPointerDown( event ) { - if( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) { + if(( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) || ( event.pointerType === "touch" )) { event.touches = [{ clientX: event.clientX, clientY: event.clientY }]; onTouchStart( event ); } @@ -2569,7 +2583,7 @@ var Reveal = (function(){ */ function onPointerMove( event ) { - if( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) { + if(( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) || ( event.pointerType === "touch" )) { event.touches = [{ clientX: event.clientX, clientY: event.clientY }]; onTouchMove( event ); } @@ -2581,7 +2595,7 @@ var Reveal = (function(){ */ function onPointerUp( event ) { - if( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) { + if(( event.pointerType === event.MSPOINTER_TYPE_TOUCH ) || ( event.pointerType === "touch" )) { event.touches = [{ clientX: event.clientX, clientY: event.clientY }]; onTouchEnd( event ); } |